Skip to content

Commit 2dbfb80

Browse files
committed
Delete unnecessary methods to fix invalidations
- Base.keys() already works on AbstractDict's so we don't need one for Accumulator. - Base.eltype() is already defined for AbstractArray's and CircularBuffer is an AbstractVector so it doesn't need to define it again. - A Base.convert() from AbstractArray to Array is already defined: https://github.com/JuliaLang/julia/blob/1ae41a2c0a3ba49d4b39dc4933dddf952b5f7f3c/base/array.jl#L612
1 parent 5156e74 commit 2dbfb80

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

src/accumulator.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ Base.setindex!(ct::Accumulator, x, v) = setindex!(ct.map, x, v)
5555

5656
Base.haskey(ct::Accumulator, x) = haskey(ct.map, x)
5757

58-
Base.keys(ct::Accumulator) = keys(ct.map)
59-
6058
Base.values(ct::Accumulator) = values(ct.map)
6159

6260
Base.sum(ct::Accumulator) = sum(values(ct.map))

src/circular_buffer.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,13 @@ Return the number of elements currently in the buffer.
154154
"""
155155
Base.length(cb::CircularBuffer) = cb.length
156156

157-
Base.eltype(::Type{CircularBuffer{T}}) where T = T
158-
159157
"""
160158
size(cb::CircularBuffer)
161159
162160
Return a tuple with the size of the buffer.
163161
"""
164162
Base.size(cb::CircularBuffer) = (length(cb),)
165163

166-
Base.convert(::Type{Array}, cb::CircularBuffer{T}) where {T} = T[x for x in cb]
167-
168164
"""
169165
isempty(cb::CircularBuffer)
170166

0 commit comments

Comments
 (0)