Mercurial > hg
comparison mercurial/manifest.py @ 7405:f1944e74e83c
manifest: fix _search() corner-case
It failed when searching the empty string in the null revision.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Tue, 25 Nov 2008 22:23:17 +0100 |
parents | 6db4a2ccef3a |
children | 08cabecfa8a8 |
comparison
equal
deleted
inserted
replaced
7404:07cb58b8c843 | 7405:f1944e74e83c |
---|---|
61 s is a string''' | 61 s is a string''' |
62 def advance(i, c): | 62 def advance(i, c): |
63 while i < lenm and m[i] != c: | 63 while i < lenm and m[i] != c: |
64 i += 1 | 64 i += 1 |
65 return i | 65 return i |
66 if not s: | |
67 return (lo, lo) | |
66 lenm = len(m) | 68 lenm = len(m) |
67 if not hi: | 69 if not hi: |
68 hi = lenm | 70 hi = lenm |
69 while lo < hi: | 71 while lo < hi: |
70 mid = (lo + hi) // 2 | 72 mid = (lo + hi) // 2 |