mq: don't reimplement any()
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 06 Feb 2018 08:57:22 -0800
changeset 36343 c8891cc3fa9e
parent 36342 02c35e640b3c
child 36344 a65502597d8d
mq: don't reimplement any() Differential Revision: https://phab.mercurial-scm.org/D2376
hgext/mq.py
--- a/hgext/mq.py	Tue Feb 06 08:55:54 2018 -0800
+++ b/hgext/mq.py	Tue Feb 06 08:57:22 2018 -0800
@@ -1555,12 +1555,8 @@
                         update = True
             else:
                 parents = [p.node() for p in repo[None].parents()]
-                needupdate = False
-                for entry in self.applied[start:]:
-                    if entry.node in parents:
-                        needupdate = True
-                        break
-                update = needupdate
+                update = any(entry.node in parents
+                             for entry in self.applied[start:])
 
             tobackup = set()
             if update: