##// END OF EJS Templates
phases: fix performance regression with Python 2...
Joerg Sonnenberger -
r46127:29a259be default
parent child Browse files
Show More
@@ -282,26 +282,28 b' def _trackphasechange(data, rev, old, ne'
282 while low < high:
282 while low < high:
283 mid = (low + high) // 2
283 mid = (low + high) // 2
284 revs = data[mid][0]
284 revs = data[mid][0]
285 revs_low = revs[0]
286 revs_high = revs[-1]
285
287
286 if rev in revs:
288 if rev >= revs_low and rev <= revs_high:
287 _sortedrange_split(data, mid, rev, t)
289 _sortedrange_split(data, mid, rev, t)
288 return
290 return
289
291
290 if revs[0] == rev + 1:
292 if revs_low == rev + 1:
291 if mid and data[mid - 1][0][-1] == rev:
293 if mid and data[mid - 1][0][-1] == rev:
292 _sortedrange_split(data, mid - 1, rev, t)
294 _sortedrange_split(data, mid - 1, rev, t)
293 else:
295 else:
294 _sortedrange_insert(data, mid, rev, t)
296 _sortedrange_insert(data, mid, rev, t)
295 return
297 return
296
298
297 if revs[-1] == rev - 1:
299 if revs_high == rev - 1:
298 if mid + 1 < len(data) and data[mid + 1][0][0] == rev:
300 if mid + 1 < len(data) and data[mid + 1][0][0] == rev:
299 _sortedrange_split(data, mid + 1, rev, t)
301 _sortedrange_split(data, mid + 1, rev, t)
300 else:
302 else:
301 _sortedrange_insert(data, mid + 1, rev, t)
303 _sortedrange_insert(data, mid + 1, rev, t)
302 return
304 return
303
305
304 if revs[0] > rev:
306 if revs_low > rev:
305 high = mid
307 high = mid
306 else:
308 else:
307 low = mid + 1
309 low = mid + 1
General Comments 0
You need to be logged in to leave comments. Login now