Skip to content

Commit

Permalink
Merge pull request #16310 from KristofferC/kc/fill_array
Browse files Browse the repository at this point in the history
make setindex with colon fall back to fill!
  • Loading branch information
JeffBezanson committed May 13, 2016
2 parents bd5c857 + 2cf2999 commit 10cc4a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ function setindex!{T}(A::Array{T}, X::Array{T}, c::Colon)
return A
end

setindex!(A::Array, x::Number, ::Colon) = fill!(A, x)
setindex!{T, N}(A::Array{T, N}, x::Number, ::Vararg{Colon, N}) = fill!(A, x)

# efficiently grow an array

function _growat!(a::Vector, i::Integer, delta::Integer)
Expand Down

0 comments on commit 10cc4a6

Please sign in to comment.