##// END OF EJS Templates
synthrepo: do not crash if a list is empty
Bryan O'Sullivan -
r18047:9196638b default
parent child Browse files
Show More
@@ -231,6 +231,8 b' def synthesize(ui, repo, descpath, **opt'
231 fp.close()
231 fp.close()
232
232
233 def cdf(l):
233 def cdf(l):
234 if not l:
235 return [], []
234 vals, probs = zip(*sorted(l, key=lambda x: x[1], reverse=True))
236 vals, probs = zip(*sorted(l, key=lambda x: x[1], reverse=True))
235 t = float(sum(probs, 0))
237 t = float(sum(probs, 0))
236 s, cdfs = 0, []
238 s, cdfs = 0, []
General Comments 0
You need to be logged in to leave comments. Login now