~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_annotator_pyx.pyx

  • Committer: John Arbash Meinel
  • Date: 2009-07-08 15:28:05 UTC
  • mto: This revision was merged to the branch mainline in revision 4522.
  • Revision ID: john@arbash-meinel.com-20090708152805-nbgmogmzfbfbuu28
Some small tweaks, add more documentation for 'add_special_text'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
    new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one)
118
118
                          + PyTuple_GET_SIZE(ann_two))
119
119
    while left != NULL and right != NULL:
120
 
        if (PyObject_RichCompareBool_ptr(left, right, Py_EQ)):
 
120
        # left == right is done by PyObject_RichCompareBool_ptr, however it
 
121
        # avoids a function call for a very common case. Drops 'time bzr
 
122
        # annotate NEWS' from 7.25s to 7.16s, so it *is* a visible impact.
 
123
        if (left == right
 
124
            or PyObject_RichCompareBool_ptr(left, right, Py_EQ)):
121
125
            # Identical values, step both
122
126
            Py_INCREF_ptr(left)
123
127
            PyTuple_SET_ITEM_ptr(new_ann, out_pos, left)