Skip to content

Commit 8444955

Browse files
committed
eliminate two-arg methods of size specific to Array and Memory
1 parent 3d3814d commit 8444955

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

base/array.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,6 @@ function vect(X...)
185185
return T[X...]
186186
end
187187

188-
size(a::Array, d::Integer) = size(a, Int(d)::Int)
189-
function size(a::Array, d::Int)
190-
d < 1 && error("arraysize: dimension out of range")
191-
sz = getfield(a, :size)
192-
return d > length(sz) ? 1 : getfield(sz, d, false) # @inbounds
193-
end
194-
195188
asize_from(a::Array, n) = n > ndims(a) ? () : (size(a,n), asize_from(a, n+1)...)
196189

197190
allocatedinline(@nospecialize T::Type) = (@_total_meta; ccall(:jl_stored_inline, Cint, (Any,), T) != Cint(0))

base/genericmemory.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ AtomicMemory
6161

6262
using Core: memoryrefoffset, memoryref_isassigned # import more functions which were not essential
6363

64-
size(a::GenericMemory, d::Int) =
65-
d < 1 ? error("dimension out of range") :
66-
d == 1 ? length(a) :
67-
1
68-
size(a::GenericMemory, d::Integer) = size(a, convert(Int, d))
6964
size(a::GenericMemory) = (length(a),)
7065

7166
IndexStyle(::Type{<:GenericMemory}) = IndexLinear()

0 commit comments

Comments
 (0)