Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e619154c81b9
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 956d2afcb2da
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Nov 16, 2015

  1. compiler.iodelay: add missing import.

    whitequark committed Nov 16, 2015
    Copy the full SHA
    7d2fca2 View commit details

Commits on Nov 17, 2015

  1. compiler.iodelay: fold Max further.

    whitequark committed Nov 17, 2015
    Copy the full SHA
    956d2af View commit details
Showing with 3 additions and 1 deletion.
  1. +3 −1 artiq/compiler/iodelay.py
4 changes: 3 additions & 1 deletion artiq/compiler/iodelay.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
a function.
"""

from functools import reduce

class Expr:
def __add__(lhs, rhs):
assert isinstance(rhs, Expr)
@@ -211,7 +213,7 @@ def fold(self, vars=None):
operand = operand.fold(vars)
if isinstance(operand, Const):
consts.append(operand.value)
else:
elif operand not in exprs:
exprs.append(operand)
if any(consts):
exprs.append(Const(max(consts)))