Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Use for loop instead of while
Browse files Browse the repository at this point in the history
  • Loading branch information
vbraun committed Jul 15, 2014
1 parent 2573b80 commit 6fb6bee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9449,14 +9449,13 @@ cdef class Expression(CommutativeRingElement):
if to_poly_solve:
if len(X) == 0:
# Maxima's solve gave no solutions
todo = [ex]
solutions_so_far = [ex]
ignore_exceptions = True
else:
todo = list(X)
solutions_so_far = X
ignore_exceptions = False
X = []
while todo:
eq = todo.pop()
for eq in solutions_so_far:
if eq.lhs().is_symbol() and (eq.lhs() == x) and (x not in eq.rhs().variables()):
X.append(eq)
continue
Expand Down

0 comments on commit 6fb6bee

Please sign in to comment.