From aeaa4644c472f8781f922118aae10b86772070c0 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Wed, 28 Aug 2019 18:47:22 -0700 Subject: [PATCH] Workaround for performance penalty of splatting a number --- stdlib/LinearAlgebra/src/generic.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/LinearAlgebra/src/generic.jl b/stdlib/LinearAlgebra/src/generic.jl index c9d6c67ac7688..b2267463aab45 100644 --- a/stdlib/LinearAlgebra/src/generic.jl +++ b/stdlib/LinearAlgebra/src/generic.jl @@ -60,7 +60,9 @@ julia> C ``` """ @inline @propagate_inbounds function _modify!(p::MulAddMul{ais1, bis0}, - x, C, idx) where {ais1, bis0} + x, C, idx′) where {ais1, bis0} + # Workaround for performance penalty of splatting a number (#29114): + idx = idx′ isa Integer ? (idx′,) : idx′ if bis0 C[idx...] = p(x) else