Skip to content

Commit 2c2daf6

Browse files
refactor: better handle inputs in wrap_array_vars
1 parent bc37f7a commit 2c2daf6

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/systems/abstractsystem.jl

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,20 +247,15 @@ function wrap_array_vars(
247247
push!(inds, (uind, i))
248248
end
249249
end
250-
p_start = uind + 1 + (inputs !== nothing) + history
251-
input_ind = inputs === nothing ? -1 : (p_start - 1)
250+
p_start = uind + 1 + history
252251
rps = (reorder_parameters(sys, ps)..., cachesyms...)
252+
if inputs !== nothing
253+
rps = (inputs, rps...)
254+
end
253255
for sym in reduce(vcat, rps; init = [])
254256
iscall(sym) && operation(sym) == getindex || continue
255257
arg = arguments(sym)[1]
256-
if inputs !== nothing
257-
idx = findfirst(isequal(sym), inputs)
258-
if idx !== nothing
259-
inds = get!(() -> [], var_to_arridxs, arg)
260-
push!(inds, (input_ind, idx))
261-
continue
262-
end
263-
end
258+
264259
bufferidx = findfirst(buf -> any(isequal(sym), buf), rps)
265260
idxinbuffer = findfirst(isequal(sym), rps[bufferidx])
266261
inds = get!(() -> [], var_to_arridxs, arg)

0 commit comments

Comments
 (0)