Skip to content

Commit 216c237

Browse files
Remove copy in termination conditions reinit!
1 parent d021f2e commit 216c237

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/NonlinearSolveBase/src/termination_conditions.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ function SciMLBase.reinit!(
9898
length(saved_value_prototype) != 0 && (cache.saved_values = saved_value_prototype)
9999

100100
mode = cache.mode
101-
u_unaliased = mode isa AbstractSafeBestNonlinearTerminationMode ?
102-
(ArrayInterface.can_setindex(u) ? copy(u) : u) : nothing
103-
cache.u = u_unaliased
101+
if ArrayInterface.can_setindex(u)
102+
cache.u .= u
103+
else
104+
cache.u = u
105+
end
104106
cache.retcode = ReturnCode.Default
105107

106108
cache.abstol = get_tolerance(u, abstol, T)

0 commit comments

Comments
 (0)