Patchwork D269: dirstate: simplify and speed up dirstate's __iter__

login
register
mail settings
Submitter phabricator
Date Aug. 8, 2017, 8:26 p.m.
Message ID <41afc0a45c263b1565e89ba97a29b476@localhost.localdomain>
Download mbox | patch
Permalink /patch/22771/
State Not Applicable
Headers show

Comments

phabricator - Aug. 8, 2017, 8:26 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG36d216dcae6a: dirstate: simplify dirstate's __iter__ (authored by alex_gaynor).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D269?vs=634&id=651

REVISION DETAIL
  https://phab.mercurial-scm.org/D269

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: alex_gaynor, durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -359,8 +359,7 @@ 
         return key in self._map
 
     def __iter__(self):
-        for x in sorted(self._map):
-            yield x
+        return iter(sorted(self._map))
 
     def items(self):
         return self._map.iteritems()