D7117: rust-dirstatemap: remove additional lookups in dirstatemap

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Oct 16 13:48:53 UTC 2019


Alphare created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We're copying this shortcut from the Python implementation, pretty standard
  for this codebase.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7117

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1726,6 +1726,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))



To: Alphare, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list