From be34478551d806b755caa4fceefd26e1fbf3388d Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Tue, 11 Aug 2015 12:59:41 -0400 Subject: [PATCH] =?UTF-8?q?Add=20missing=20fallbacks=20from=20unsafe=20?= =?UTF-8?q?=E2=86=92=20safe=20indexing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/abstractarray.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index ea2d895b9e949..356f60a868776 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -477,7 +477,7 @@ _getindex{T}(::LinearSlow, A::AbstractArray{T,0}) = error("indexing not defined _getindex(::LinearSlow, A::AbstractVector) = (@_inline_meta; getindex(A, 1)) _getindex(l::LinearSlow, A::AbstractArray) = (@_inline_meta; _getindex(l, A, 1)) _unsafe_getindex(::LinearFast, A::AbstractArray) = (@_inline_meta; unsafe_getindex(A, 1)) -_unsafe_getindex{T}(::LinearSlow, A::AbstractArray{T,0}) = error("indexing not defined for ", typeof(A)) +_unsafe_getindex{T}(::LinearSlow, A::AbstractArray{T,0}) = (@_inline_meta; getindex(A)) _unsafe_getindex(::LinearSlow, A::AbstractVector) = (@_inline_meta; unsafe_getindex(A, 1)) _unsafe_getindex(l::LinearSlow, A::AbstractArray) = (@_inline_meta; _unsafe_getindex(l, A, 1)) @@ -579,7 +579,7 @@ _setindex!{T}(::LinearSlow, A::AbstractArray{T,0}, v) = error("indexing not defi _setindex!(::LinearSlow, A::AbstractVector, v) = (@_inline_meta; setindex!(A, v, 1)) _setindex!(l::LinearSlow, A::AbstractArray, v) = (@_inline_meta; _setindex!(l, A, v, 1)) _unsafe_setindex!(::LinearFast, A::AbstractArray, v) = (@_inline_meta; unsafe_setindex!(A, v, 1)) -_unsafe_setindex!{T}(::LinearSlow, A::AbstractArray{T,0}, v) = error("indexing not defined for ", typeof(A)) +_unsafe_setindex!{T}(::LinearSlow, A::AbstractArray{T,0}, v) = (@_inline_meta; setindex!(A, v)) _unsafe_setindex!(::LinearSlow, A::AbstractVector, v) = (@_inline_meta; unsafe_setindex!(A, v, 1)) _unsafe_setindex!(l::LinearSlow, A::AbstractArray, v) = (@_inline_meta; _unsafe_setindex!(l, A, v, 1))