rust-dirstatemap: remove additional lookups in dirstatemap
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 16 Oct 2019 10:14:26 +0200
changeset 43280 5d4046594d6f
parent 43279 726bd0b612a2
child 43281 6230c70a1863
rust-dirstatemap: remove additional lookups in dirstatemap We're copying this shortcut from the Python implementation, pretty standard for this codebase. Differential Revision: https://phab.mercurial-scm.org/D7117
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Thu Oct 17 21:37:21 2019 +0200
+++ b/mercurial/dirstate.py	Wed Oct 16 10:14:26 2019 +0200
@@ -1784,6 +1784,10 @@
             if parents and not self._dirtyparents:
                 self.setparents(*parents)
 
+            self.__contains__ = self._rustmap.__contains__
+            self.__getitem__ = self._rustmap.__getitem__
+            self.get = self._rustmap.get
+
         def write(self, st, now):
             parents = self.parents()
             st.write(self._rustmap.write(parents[0], parents[1], now))