setdiscovery: avoid a Yoda condition
Differential Revision: https://phab.mercurial-scm.org/D2646
--- 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