Skip to content

Commit

Permalink
Cleanup flatten code
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdrake committed Feb 11, 2015
1 parent 538d33b commit 874aad0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyeda/boolalg/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,9 +1506,9 @@ def _flatten(self, op):
if ex.depth < 2 or isinstance(ex, op.get_dual()):
return ex
else:
args = {x._lits for x in ex.xs}
prod = {frozenset(t) for t in itertools.product(*args)}
return op.get_dual()(*[op(*t) for t in prod]).simplify()
terms = {x._lits for x in ex.xs}
xs = {op(*t) for t in itertools.product(*terms)}
return op.get_dual()(*xs).simplify()._absorb()

# FlattenedExpression
@cached_property
Expand Down

0 comments on commit 874aad0

Please sign in to comment.