Skip to content

Commit

Permalink
Workaround for performance penalty of splatting a number (#33108)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4bf946a)
  • Loading branch information
tkf authored and Kristoffer Carlsson committed Sep 3, 2019
1 parent eac42ce commit 5f214ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion stdlib/LinearAlgebra/src/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f214ab

Please sign in to comment.