delta-find: move delta size check earlier in is_good_delta_info
This will clarify future patches by regrouping related logic before larger
movement.
--- a/mercurial/revlogutils/deltas.py Thu Jan 04 15:04:10 2024 +0100
+++ b/mercurial/revlogutils/deltas.py Thu Jan 04 15:35:36 2024 +0100
@@ -1057,6 +1057,13 @@
or not self.revlog.delta_config.general_delta
)
+ # Bad delta from new delta size:
+ #
+ # If the delta size is larger than the target text, storing the delta
+ # will be inefficient.
+ if self.revinfo.textlen < deltainfo.deltalen:
+ return False
+
# - '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
@@ -1085,13 +1092,6 @@
):
return False
- # Bad delta from new delta size:
- #
- # If the delta size is larger than the target text, storing the delta
- # will be inefficient.
- if textlen < deltainfo.deltalen:
- return False
-
# Bad delta from cumulated payload size:
#
# If the sum of delta get larger than K * target text length.