From 2cf299928671a9719ab2a3e5e36c5188cbc334be Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Wed, 11 May 2016 16:17:28 +0200 Subject: [PATCH] make setindex with colon fall back to fill! --- base/array.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/array.jl b/base/array.jl index 6c1918db755b6..d84f067b0d329 100644 --- a/base/array.jl +++ b/base/array.jl @@ -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)