Patchwork D2371: walkrepos: don't reimplement any()

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 8:40 p.m.
Message ID <708f43ce23536f60ac673e59617e156f@localhost.localdomain>
Download mbox | patch
Permalink /patch/28206/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2018, 8:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGddd9474d2e08: walkrepos: don&#039;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




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

Patch

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