~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_dirstate_helpers_pyx.pyx

  • Committer: Vincent Ladeuil
  • Date: 2009-06-23 06:58:24 UTC
  • mto: (4471.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4472.
  • Revision ID: v.ladeuil+lp@free.fr-20090623065824-tgitxb0v96qa8utd
Fixed as per John and Martin reviews.

* bzrlib/_dirstate_helpers_pyx.pyx:
(_cmp_path_by_dirblock_intern): Renamed as requested.

Show diffs side-by-side

added added

removed removed

Lines of Context:
288
288
    if not PyString_CheckExact(path2):
289
289
        raise TypeError("'path2' must be a plain string, not %s: %r"
290
290
                        % (type(path2), path2))
291
 
    return __cmp_path_by_dirblock(PyString_AsString(path1),
292
 
                                 PyString_Size(path1),
293
 
                                 PyString_AsString(path2),
294
 
                                 PyString_Size(path2))
295
 
 
296
 
 
297
 
cdef int __cmp_path_by_dirblock(char *path1, int path1_len,
298
 
                               char *path2, int path2_len):
 
291
    return _cmp_path_by_dirblock_intern(PyString_AsString(path1),
 
292
                                        PyString_Size(path1),
 
293
                                        PyString_AsString(path2),
 
294
                                        PyString_Size(path2))
 
295
 
 
296
 
 
297
cdef int _cmp_path_by_dirblock_intern(char *path1, int path1_len,
 
298
                                      char *path2, int path2_len):
299
299
    """Compare two paths by what directory they are in.
300
300
 
301
301
    see ``_cmp_path_by_dirblock`` for details.
413
413
        cur = PyList_GetItem_object_void(paths, _mid)
414
414
        cur_cstr = PyString_AS_STRING_void(cur)
415
415
        cur_size = PyString_GET_SIZE_void(cur)
416
 
        if __cmp_path_by_dirblock(cur_cstr, cur_size, path_cstr, path_size) < 0:
 
416
        if _cmp_path_by_dirblock_intern(cur_cstr, cur_size,
 
417
                                        path_cstr, path_size) < 0:
417
418
            _lo = _mid + 1
418
419
        else:
419
420
            _hi = _mid
465
466
        cur = PyList_GetItem_object_void(paths, _mid)
466
467
        cur_cstr = PyString_AS_STRING_void(cur)
467
468
        cur_size = PyString_GET_SIZE_void(cur)
468
 
        if __cmp_path_by_dirblock(path_cstr, path_size, cur_cstr, cur_size) < 0:
 
469
        if _cmp_path_by_dirblock_intern(path_cstr, path_size,
 
470
                                        cur_cstr, cur_size) < 0:
469
471
            _hi = _mid
470
472
        else:
471
473
            _lo = _mid + 1