changeset 51326:01db705bbe32

delta-find: move tested in the _DeltaSearch.__init__ Now that we have an object we can initialize that attribute at initialization time. This will make it available for more method in the future, allowing to split the code.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Nov 2023 01:13:40 +0100
parents c9ab452e5611
children a4af7507fa4b
files mercurial/revlogutils/deltas.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlogutils/deltas.py	Mon Nov 20 05:05:29 2023 +0100
+++ b/mercurial/revlogutils/deltas.py	Thu Nov 23 01:13:40 2023 +0100
@@ -715,6 +715,8 @@
             snapshot_cache = SnapshotCache()
         self.snapshot_cache = snapshot_cache
 
+        self.tested = {nullrev}
+
     def candidate_groups(self):
         """Provides group of revision to be tested as delta base
 
@@ -741,7 +743,7 @@
         deltas_limit = self.textlen * LIMIT_DELTA2TEXT
         group_chunk_size = self.revlog.delta_config.candidate_group_chunk_size
 
-        tested = {nullrev}
+        tested = self.tested  # prefetch for speed and code compactness
         candidates = self._refined_groups()
         while True:
             temptative = candidates.send(good)