Skip to content

Commit 372783a

Browse files
Merge pull request #1403 from hersle/fix_fixpoint_sub
Fix fixpoint_sub warning
2 parents 19b252e + ab99113 commit 372783a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/variable.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ function _recursive_unwrap(val)
530530
end
531531

532532
"""
533-
fixpoint_sub(expr, dict; operator = Nothing, maxiters = 10000)
533+
fixpoint_sub(expr, dict; operator = Nothing, maxiters = 1000)
534534
535535
Given a symbolic expression, equation or inequality `expr` perform the substitutions in
536536
`dict` recursively until the expression does not change. Substitutions that depend on one
@@ -546,10 +546,11 @@ See also: [`fast_substitute`](@ref).
546546
function fixpoint_sub(x, dict; operator = Nothing, maxiters = 1000)
547547
dict = subrules_to_dict(dict)
548548
y = fast_substitute(x, dict; operator)
549-
while !isequal(x, y) && maxiters > 0
549+
iters = maxiters
550+
while !isequal(x, y) && iters > 0
550551
y = x
551552
x = fast_substitute(y, dict; operator)
552-
maxiters -= 1
553+
iters -= 1
553554
end
554555

555556
if !isequal(x, y)

0 commit comments

Comments
 (0)