# HG changeset patch # User Drew Gottlieb # Date 1427487373 25200 # Node ID 4daae7edf166b9b126d0dfee3d7b593b3b9d6586 # Parent bcf0de51326e96b3b665dcecf4ffcc10bcd612ac treemanifest: remove treemanifest._intersectfiles() In preparation for the optimization in the following commit, this commit removes treemanifest.matches()'s call to _intersectfiles(), and removes _intersectfiles() itself since it's unused at this point. diff -r bcf0de51326e -r 4daae7edf166 mercurial/manifest.py --- a/mercurial/manifest.py Mon Mar 30 11:58:39 2015 -0700 +++ b/mercurial/manifest.py Fri Mar 27 13:16:13 2015 -0700 @@ -480,19 +480,6 @@ copy._flags = dict.copy(self._flags) return copy - def _intersectfiles(self, files): - '''make a new treemanifest with the intersection of self with files - - The algorithm assumes that files is much smaller than self.''' - ret = treemanifest() - for fn in files: - if fn in self: - ret[fn] = self[fn] - flags = self.flags(fn) - if flags: - ret.setflag(fn, flags) - return ret - def filesnotin(self, m2): '''Set of files in this manifest that are not in the other''' files = set() @@ -531,11 +518,6 @@ if match.always(): return self.copy() - files = match.files() - if (match.isexact() or - (not match.anypats() and util.all(fn in self for fn in files))): - return self._intersectfiles(files) - m = self.copy() for fn in m.keys(): if not match(fn):