Skip to content

Commit 5d26f74

Browse files
committed
perf: remove allocations in MultipleSetters
map does collect internally, so that allocates
1 parent 09b14ea commit 5d26f74

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parameter_indexing.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,9 @@ struct MultipleSetters{S} <: AbstractSetIndexer
713713
end
714714

715715
function (ms::MultipleSetters)(prob, val)
716-
map((s!, v) -> s!(prob, v), ms.setters, val)
716+
for (s!, v) in zip(ms.setters, val)
717+
s!(prob, v)
718+
end
717719
end
718720

719721
for (t1, t2) in [

0 commit comments

Comments
 (0)