Mercurial > hg
comparison mercurial/revlog.py @ 38635:d083ae26c325
revlog: early return in _slicechunk when span is already small enough
If the full span is smaller than the minimum gap size we'll consider, we know we
won't do any slicing and we can return earlier.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 10 Jul 2018 15:17:05 -0700 |
parents | f0ea8b847831 |
children | 25534e0cf0d9 |
comparison
equal
deleted
inserted
replaced
38634:f0ea8b847831 | 38635:d083ae26c325 |
---|---|
224 return | 224 return |
225 | 225 |
226 startbyte = start(revs[0]) | 226 startbyte = start(revs[0]) |
227 endbyte = start(revs[-1]) + length(revs[-1]) | 227 endbyte = start(revs[-1]) + length(revs[-1]) |
228 readdata = deltachainspan = endbyte - startbyte | 228 readdata = deltachainspan = endbyte - startbyte |
229 | |
230 if deltachainspan < revlog._srmingapsize: | |
231 yield revs | |
232 return | |
229 | 233 |
230 chainpayload = sum(length(r) for r in revs) | 234 chainpayload = sum(length(r) for r in revs) |
231 | 235 |
232 if deltachainspan: | 236 if deltachainspan: |
233 density = chainpayload / float(deltachainspan) | 237 density = chainpayload / float(deltachainspan) |