mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
synthrepo: do not crash if a list is empty
This commit is contained in:
parent
d3a4755c75
commit
75dc399824
@ -231,6 +231,8 @@ def synthesize(ui, repo, descpath, **opts):
|
||||
fp.close()
|
||||
|
||||
def cdf(l):
|
||||
if not l:
|
||||
return [], []
|
||||
vals, probs = zip(*sorted(l, key=lambda x: x[1], reverse=True))
|
||||
t = float(sum(probs, 0))
|
||||
s, cdfs = 0, []
|
||||
|
Loading…
Reference in New Issue
Block a user