Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dirstate.py @ 47482:eb416759af7e
dirstate: Removed unused instances of `DirsMultiset`
? in Rust-backed dirstatemap.
The Python class `dirstatemap` had cached properties `_dirs` and `_alldirs`
that were not used for `hastrackeddir` and `hasdir` since they were redundant
with corresponding fields for the Rust `DirstateMap` struct.
`dirfoldmap` is modified to reuse instead the directory iterator introduced
in 3b9914b28133c0918186b6e8b9e4f1916e21338d.
Differential Revision: https://phab.mercurial-scm.org/D10921
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 28 Jun 2021 15:52:10 +0200 |
parents | 3b9914b28133 |
children | e6b303eb8f7d |
line wrap: on
line diff
--- a/mercurial/dirstate.py Mon Jun 28 15:41:50 2021 +0200 +++ b/mercurial/dirstate.py Mon Jun 28 15:52:10 2021 +0200 @@ -1951,22 +1951,12 @@ return self._rustmap.filefoldmapasdict() def hastrackeddir(self, d): - self._dirs # Trigger Python's propertycache return self._rustmap.hastrackeddir(d) def hasdir(self, d): - self._dirs # Trigger Python's propertycache return self._rustmap.hasdir(d) @propertycache - def _dirs(self): - return self._rustmap.getdirs() - - @propertycache - def _alldirs(self): - return self._rustmap.getalldirs() - - @propertycache def identity(self): self._rustmap return self.identity @@ -1988,6 +1978,6 @@ def dirfoldmap(self): f = {} normcase = util.normcase - for name in self._dirs: + for name, _pseudo_entry in self.directories(): f[normcase(name)] = name return f