forked from M-Labs/artiq
1
0
Fork 0

compiler.iodelay: correctly fold max(0, [0, ]...).

This commit is contained in:
whitequark 2015-11-24 00:46:55 +08:00
parent 9bc62fa3d2
commit d3f0059cab
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ class Max(Expr):
consts.append(operand.value) consts.append(operand.value)
elif operand not in exprs: elif operand not in exprs:
exprs.append(operand) exprs.append(operand)
if any(consts): if len(consts) > 0:
exprs.append(Const(max(consts))) exprs.append(Const(max(consts)))
if len(exprs) == 1: if len(exprs) == 1:
return exprs[0] return exprs[0]