From patchwork Wed Oct 16 13:48:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7118: rust-dirstatemap: remove additional lookups in traverse From: phabricator X-Patchwork-Id: 42384 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 16 Oct 2019 13:48:59 +0000 Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We use the same trick as the Python implementation. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D7118 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS To: Alphare, #hg-reviewers Cc: mercurial-devel diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -919,6 +919,9 @@ matchalways = match.always() matchtdir = match.traversedir dmap = self._map + if rustmod is not None: + dmap = self._map._rustmap + listdir = util.listdir lstat = os.lstat dirkind = stat.S_IFDIR