Skip to content

Commit cf3ce51

Browse files
give back the SArray overload, but now, better
1 parent 1e97615 commit cf3ce51

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/build_function.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,18 @@ function _build_function(target::JuliaTarget, rhss, args...;
331331
arr_sys_expr = build_expr(:vect, [conv(rhs) for rhs rhss])
332332
end
333333

334+
arr_sys_expr = quote
335+
if typeof($(fargs.args[1])) <: SArray && $(!(rhss isa SparseMatrixCSC))
336+
@SArray $arr_sys_expr
337+
else
338+
$arr_sys_expr
339+
end
340+
end
341+
334342
let_expr = Expr(:let, var_eqs, tuple_sys_expr)
335343
arr_let_expr = Expr(:let, var_eqs, arr_sys_expr)
336344
bounds_block = checkbounds ? let_expr : :(@inbounds begin $let_expr end)
337-
oop_body_block = checkbounds ? arr_let_expr : :(@inbounds begin $arr_let_expr end)
345+
arr_bounds_block = checkbounds ? arr_let_expr : :(@inbounds begin $arr_let_expr end)
338346
ip_bounds_block = checkbounds ? ip_let_expr : :(@inbounds begin $ip_let_expr end)
339347

340348
oop_ex = headerfun(oop_body_block, fargs, false)

0 commit comments

Comments
 (0)