Skip to content

Commit

Permalink
Make broadcast!(f, A) populate A via independent f() calls rather tha…
Browse files Browse the repository at this point in the history
…n fill!(A, f()).
  • Loading branch information
Sacha0 committed Dec 25, 2016
1 parent 4793e88 commit bafb7d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Symbol(x...) = Symbol(string(x...))
# specific array types etc.
# --Here, just define fallback routines for broadcasting with no arguments
broadcast(f) = f()
broadcast!(f, X::AbstractArray) = fill!(X, f())
broadcast!(f, X::AbstractArray) = (for I in eachindex(X); X[I] = f(); end; X)

# array structures
include("array.jl")
Expand Down

0 comments on commit bafb7d0

Please sign in to comment.