Skip to content
Snippets Groups Projects
  • Yuya Nishihara's avatar
    bdb177923291
    ancestor: optimize _lazyancestorsiter() for contiguous chains · bdb177923291
    Yuya Nishihara authored
    If there's no revision between p1 and current, p1 must be the next revision
    to visit. In this case, we can get around the overhead of heappop/push
    operations. Note that this is faster than using heapreplace().
    
    'current - p1 == 1' could be generalized as 'all(r not in seen for r in
    xrange(p1, current)', but Python is too slow to do such thing.
    bdb177923291
    History
    ancestor: optimize _lazyancestorsiter() for contiguous chains
    Yuya Nishihara authored
    If there's no revision between p1 and current, p1 must be the next revision
    to visit. In this case, we can get around the overhead of heappop/push
    operations. Note that this is faster than using heapreplace().
    
    'current - p1 == 1' could be generalized as 'all(r not in seen for r in
    xrange(p1, current)', but Python is too slow to do such thing.