Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit e8db754

Browse files
authored
Try #1537:
2 parents 2f3ed54 + 9996457 commit e8db754

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Utilities/VariableTemplates/VariableTemplates.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,14 @@ end
309309
offset += 1
310310
elseif T <: StaticArray
311311
N = length(T)
312-
retexpr = :(array[:, ($(offset + 1)):($(offset + N))] = val)
312+
retexpr = :(
313+
array[
314+
:,
315+
# static range is used here to force dispatch to
316+
# StaticArrays setindex! because generic setindex! is slow
317+
StaticArrays.SUnitRange($(offset + 1), $(offset + N)),
318+
] = val
319+
)
313320
offset += N
314321
else
315322
offset += varsize(T)

0 commit comments

Comments
 (0)