# HG changeset patch # User Alexander Krauss # Date 2011-07-16 10:22:40 # Node ID 01e0091679c04622fc4e86d760f21d5d72b887b2 # Parent 62122c1c830b985bf271eb29b7c4760bb6f835f9 hbisect: confine loop to the relevant interval In this context we know that ancestors[rev] == None for all rev <= goodrev, so looping further back is unnecessary (and confusing). diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py --- a/mercurial/hbisect.py +++ b/mercurial/hbisect.py @@ -45,7 +45,7 @@ def bisect(changelog, state): # clear good revs from array for node in goodrevs: ancestors[node] = None - for rev in xrange(len(changelog), -1, -1): + for rev in xrange(len(changelog), goodrev, -1): if ancestors[rev] is None: for prev in clparents(rev): ancestors[prev] = None