setdiscovery: avoid a Yoda condition
authorMartin von Zweigbergk <martinvonz@google.com>
Sun, 04 Mar 2018 07:40:21 -0800
changeset 36718 59802fa590db
parent 36717 0968e400406c
child 36719 390d16ea7c76
setdiscovery: avoid a Yoda condition Differential Revision: https://phab.mercurial-scm.org/D2646
mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py	Sun Mar 04 07:40:11 2018 -0800
+++ b/mercurial/setdiscovery.py	Sun Mar 04 07:40:21 2018 -0800
@@ -106,7 +106,7 @@
     :nodes: set of nodes to discover
     :size: the maximum size of the sample"""
     sample = dag.headsetofconnecteds(nodes)
-    if size <= len(sample):
+    if len(sample) >= size:
         return _limitsample(sample, size)
     _updatesample(dag, None, sample, quicksamplesize=size)
     return sample