##// END OF EJS Templates
ancestor: use heapreplace() in place of heappop/heappush()...
Yuya Nishihara -
r39574:238a1480 default
parent child Browse files
Show More
@@ -264,6 +264,7 b' def _lazyancestorsiter(parentrevs, initr'
264 seen = {nullrev}
264 seen = {nullrev}
265 heappush = heapq.heappush
265 heappush = heapq.heappush
266 heappop = heapq.heappop
266 heappop = heapq.heappop
267 heapreplace = heapq.heapreplace
267 see = seen.add
268 see = seen.add
268
269
269 if inclusive:
270 if inclusive:
@@ -294,8 +295,7 b' def _lazyancestorsiter(parentrevs, initr'
294 if current - p1 == 1:
295 if current - p1 == 1:
295 visit[0] = -p1
296 visit[0] = -p1
296 else:
297 else:
297 heappop(visit)
298 heapreplace(visit, -p1)
298 heappush(visit, -p1)
299 see(p1)
299 see(p1)
300 else:
300 else:
301 heappop(visit)
301 heappop(visit)
General Comments 0
You need to be logged in to leave comments. Login now