changeset 36338:ddd9474d2e08

walkrepos: don't reimplement any() Differential Revision: https://phab.mercurial-scm.org/D2371
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Feb 2018 08:48:05 -0800
parents 0f36926b2651
children a4d41ba4ad23
files mercurial/scmutil.py
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Wed Feb 21 00:25:16 2018 +0530
+++ b/mercurial/scmutil.py	Tue Feb 06 08:48:05 2018 -0800
@@ -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