Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 17949:407209261f63 stable
grep: remove useless while condition
A revised version of 35ba170c0f82 was sent to the list that fixed this
<http://markmail.org/message/jmfuiise5igcyh2m>, but the older version of
the patch was applied.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Thu, 15 Nov 2012 11:27:30 -0600 |
parents | 35ba170c0f82 |
children | a1f94e2f5da2 e689b0d91546 |
comparison
equal
deleted
inserted
replaced
17931:35ba170c0f82 | 17949:407209261f63 |
---|---|
2933 getfile = util.lrucachefunc(repo.file) | 2933 getfile = util.lrucachefunc(repo.file) |
2934 | 2934 |
2935 def matchlines(body): | 2935 def matchlines(body): |
2936 begin = 0 | 2936 begin = 0 |
2937 linenum = 0 | 2937 linenum = 0 |
2938 while True and begin < len(body): | 2938 while begin < len(body): |
2939 match = regexp.search(body, begin) | 2939 match = regexp.search(body, begin) |
2940 if not match: | 2940 if not match: |
2941 break | 2941 break |
2942 mstart, mend = match.span() | 2942 mstart, mend = match.span() |
2943 linenum += body.count('\n', begin, mstart) + 1 | 2943 linenum += body.count('\n', begin, mstart) + 1 |