mercurial/localrepo.py
changeset 40423 597bb5a6867f
parent 40390 7e3b6c4f01a2
child 40424 7caf632e30c3
--- a/mercurial/localrepo.py	Thu Oct 18 19:57:30 2018 -0700
+++ b/mercurial/localrepo.py	Sat Oct 20 19:13:05 2018 +0900
@@ -91,7 +91,13 @@
     def __get__(self, repo, type=None):
         if repo is None:
             return self
-        return super(_basefilecache, self).__get__(repo.unfiltered(), type)
+        # inlined the fast path as the cost of function call matters
+        unfi = repo.unfiltered()
+        try:
+            return unfi.__dict__[self.sname]
+        except KeyError:
+            pass
+        return super(_basefilecache, self).__get__(unfi, type)
     def __set__(self, repo, value):
         return super(_basefilecache, self).__set__(repo.unfiltered(), value)
     def __delete__(self, repo):