Skip to content

Commit 8f168c5

Browse files
authored
fix empty reduce issue
1 parent 427d255 commit 8f168c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/build_function.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function _build_function(target::JuliaTarget, rhss, args...;
114114
elseif eltype(rhss) <: SparseMatrixCSC # Array of sparse matrices
115115
ip_sys_exprs = reduce(vcat,[vec([:($X[$i].nzval[$j] = $(conv(rhs))) for (j, rhs) enumerate(rhsel)]) for (i,rhsel) enumerate(rhss)])
116116
elseif eltype(rhss) <: AbstractArray # Array of arrays
117-
ip_sys_exprs = reduce(vcat,[vec([:($X[$i][$j] = $(conv(rhs))) for (j, rhs) enumerate(rhsel)]) for (i,rhsel) enumerate(rhss)])
117+
ip_sys_exprs = reduce(vcat,[vec([:($X[$i][$j] = $(conv(rhs))) for (j, rhs) enumerate(rhsel)]) for (i,rhsel) enumerate(rhss)], init = Expr[])
118118
elseif rhss isa SparseMatrixCSC
119119
ip_sys_exprs = [:($X.nzval[$i] = $(conv(rhs))) for (i, rhs) enumerate(rhss.nzval)]
120120
else

0 commit comments

Comments
 (0)