Mercurial > hg-stable
changeset 38149:bf59f95583c1
revlog: make variable name 'd' more explicit in _isgooddeltainfo
d -> deltainfo
author | Paul Morelle <paul.morelle@octobus.net> |
---|---|
date | Wed, 07 Mar 2018 12:00:07 +0100 |
parents | b17fa9041695 |
children | 69ec6f98cfa6 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 11 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Thu Apr 19 07:57:06 2018 +0200 +++ b/mercurial/revlog.py Wed Mar 07 12:00:07 2018 +0100 @@ -2093,26 +2093,27 @@ return compressor.decompress(data) - def _isgooddeltainfo(self, d, textlen): + def _isgooddeltainfo(self, deltainfo, textlen): """Returns True if the given delta is good. Good means that it is within the disk span, disk size, and chain length bounds that we know to be performant.""" - if d is None: + if deltainfo is None: return False - # - 'd.distance' is the distance from the base revision -- bounding it - # limits the amount of I/O we need to do. - # - 'd.compresseddeltalen' is the sum of the total size of deltas we - # need to apply -- bounding it limits the amount of CPU we consume. + # - 'deltainfo.distance' is the distance from the base revision -- + # bounding it limits the amount of I/O we need to do. + # - 'deltainfo.compresseddeltalen' is the sum of the total size of + # deltas we need to apply -- bounding it limits the amount of CPU + # we consume. defaultmax = textlen * 4 maxdist = self._maxdeltachainspan if not maxdist: - maxdist = d.distance # ensure the conditional pass + maxdist = deltainfo.distance # ensure the conditional pass maxdist = max(maxdist, defaultmax) - if (d.distance > maxdist or d.deltalen > textlen or - d.compresseddeltalen > textlen * 2 or - (self._maxchainlen and d.chainlen > self._maxchainlen)): + if (deltainfo.distance > maxdist or deltainfo.deltalen > textlen or + deltainfo.compresseddeltalen > textlen * 2 or + (self._maxchainlen and deltainfo.chainlen > self._maxchainlen)): return False return True