changeset 35919:6c1d3779c052

discovery: don't reimplement all() Differential Revision: https://phab.mercurial-scm.org/D1993
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 01 Feb 2018 10:10:01 -0800
parents 6e7fae8f1c6c
children 6bd2846a82e8
files mercurial/discovery.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/discovery.py	Thu Feb 01 16:01:43 2018 -0500
+++ b/mercurial/discovery.py	Thu Feb 01 10:10:01 2018 -0800
@@ -53,13 +53,8 @@
         return treediscovery.findcommonincoming(repo, remote, heads, force)
 
     if heads:
-        allknown = True
         knownnode = repo.changelog.hasnode # no nodemap until it is filtered
-        for h in heads:
-            if not knownnode(h):
-                allknown = False
-                break
-        if allknown:
+        if all(knownnode(h) for h in heads):
             return (heads, False, heads)
 
     res = setdiscovery.findcommonheads(repo.ui, repo, remote, heads,