cjdrake / pyeda

Python EDA
BSD 2-Clause "Simplified" License
305 stars 55 forks source link

Fix expression depth definition #92

Closed cjdrake closed 10 years ago

cjdrake commented 10 years ago

The current definition of Expression.depth is a bit weird. In particular:

Also, the calculation is a bit wasteful. It calculates max(arg.depth + 1 for arg in self.args). It would be cheaper to calculate max(arg.depth for arg in self.args) + 1.