revlog: extract `deltainfo.distance` for future conditional redefinition
This commit exist to make the next one clearer.
--- a/mercurial/revlog.py Mon Jul 16 14:04:48 2018 -0700
+++ b/mercurial/revlog.py Mon Jun 04 12:12:00 2018 +0200
@@ -2398,13 +2398,14 @@
# deltas we need to apply -- bounding it limits the amount of CPU
# we consume.
+ distance = deltainfo.distance
textlen = revinfo.textlen
defaultmax = textlen * 4
maxdist = self._maxdeltachainspan
if not maxdist:
- maxdist = deltainfo.distance # ensure the conditional pass
+ maxdist = distance # ensure the conditional pass
maxdist = max(maxdist, defaultmax)
- if (deltainfo.distance > maxdist or deltainfo.deltalen > textlen or
+ if (distance > maxdist or deltainfo.deltalen > textlen or
deltainfo.compresseddeltalen > textlen * 2 or
(self._maxchainlen and deltainfo.chainlen > self._maxchainlen)):
return False