Mercurial > hg
comparison mercurial/manifest.py @ 11763:69e0bcf36961
manifest: removed usage of the global cmp function
Py3k doesn't have a global cmp() function, making this call problematic in the
py3k port. Also, calling cmp() here is not necessary, since we only want to
know if the two values are equal. A check for equality perfect in this case and
this patch does that.
author | Renato Cunha <renatoc@gmail.com> |
---|---|
date | Sat, 07 Aug 2010 16:12:51 -0300 |
parents | 08a0f04b56bd |
children | cf858e76e992 |
comparison
equal
deleted
inserted
replaced
11762:8b03c988efb3 | 11763:69e0bcf36961 |
---|---|
82 else: | 82 else: |
83 # this translates to the bisect hi = mid | 83 # this translates to the bisect hi = mid |
84 hi = start | 84 hi = start |
85 end = advance(lo, '\0') | 85 end = advance(lo, '\0') |
86 found = m[lo:end] | 86 found = m[lo:end] |
87 if cmp(s, found) == 0: | 87 if s == found: |
88 # we know that after the null there are 40 bytes of sha1 | 88 # we know that after the null there are 40 bytes of sha1 |
89 end = advance(end + 40, '\n') | 89 end = advance(end + 40, '\n') |
90 return (lo, end + 1) | 90 return (lo, end + 1) |
91 else: | 91 else: |
92 return (lo, lo) | 92 return (lo, lo) |