Skip to content

Commit

Permalink
make setindex with colon fall back to fill!
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed May 11, 2016
1 parent c9d4051 commit df1e458
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!{T}(A::Array{T}, x::Number, c::Colon) = fill!(A, x)
setindex!{T, N}(A::Array{T, N}, x::Number, c::Vararg{Colon, N}) = fill!(A, x)

# efficiently grow an array

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

0 comments on commit df1e458

Please sign in to comment.