D2371: walkrepos: don't reimplement any()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 21 15:40:10 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGddd9474d2e08: walkrepos: don't reimplement any() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2371?vs=5951&id=5957

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

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -357,12 +357,8 @@
     samestat = getattr(os.path, 'samestat', None)
     if followsym and samestat is not None:
         def adddir(dirlst, dirname):
-            match = False
             dirstat = os.stat(dirname)
-            for lstdirstat in dirlst:
-                if samestat(dirstat, lstdirstat):
-                    match = True
-                    break
+            match = any(samestat(dirstat, lstdirstat) for lstdirstat in dirlst)
             if not match:
                 dirlst.append(dirstat)
             return not match



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


More information about the Mercurial-devel mailing list