largefiles: drop unnecessary setting of matcher._always
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 30 Oct 2014 22:32:39 -0700
changeset 23144 55325a327754
parent 23143 cd0c51c07e5f
child 23145 97b6e762f218
largefiles: drop unnecessary setting of matcher._always In two very similar segments of code, an existing matcher is modified by changing its _files attribute through a map and a filter operation. Neither operation can cause an empty list to become non-empty, so a matcher that always matches can not stop always matching. Drop the setting of the attribute, so we don't unnecessarily prevent the fast paths to be taken where these matchers end up being used.
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Sun Oct 19 03:22:23 2014 +0200
+++ b/hgext/largefiles/overrides.py	Thu Oct 30 22:32:39 2014 -0700
@@ -576,7 +576,6 @@
                 lfile = lambda f: lfutil.standin(f) in manifest
                 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
                 m._fmap = set(m._files)
-                m._always = False
                 origmatchfn = m.matchfn
                 m.matchfn = lambda f: (lfutil.isstandin(f) and
                                     (f in manifest) and
@@ -684,7 +683,6 @@
             m._files = [tostandin(f) for f in m._files]
             m._files = [f for f in m._files if f is not None]
             m._fmap = set(m._files)
-            m._always = False
             origmatchfn = m.matchfn
             def matchfn(f):
                 if lfutil.isstandin(f):