Skip to content

Commit a11e824

Browse files
committed
eliminate GenericMemory-specific length method
1 parent 8444955 commit a11e824

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

base/essentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Bottom = Union{}
99
# Define minimal array interface here to help code used in macros:
1010
size(a::Array) = getfield(a, :size)
1111
length(t::AbstractArray) = (@inline; prod(size(t)))
12-
length(a::GenericMemory) = getfield(a, :length)
12+
size(a::GenericMemory) = (getfield(a, :length),)
1313
throw_boundserror(A, I) = (@noinline; throw(BoundsError(A, I)))
1414

1515
# multidimensional getindex will be defined later on

base/genericmemory.jl

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

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

64-
size(a::GenericMemory) = (length(a),)
65-
6664
IndexStyle(::Type{<:GenericMemory}) = IndexLinear()
6765

6866
parent(ref::GenericMemoryRef) = ref.mem

0 commit comments

Comments
 (0)