From 2dbfb80e37fc5bb7cbb8fd34d0b10086fd3ed9b8 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 12 Apr 2024 12:55:05 +0200 Subject: [PATCH 1/2] 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 --- src/accumulator.jl | 2 -- src/circular_buffer.jl | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/accumulator.jl b/src/accumulator.jl index c9fab92e4..015b0ebfd 100644 --- a/src/accumulator.jl +++ b/src/accumulator.jl @@ -55,8 +55,6 @@ Base.setindex!(ct::Accumulator, x, v) = setindex!(ct.map, x, v) Base.haskey(ct::Accumulator, x) = haskey(ct.map, x) -Base.keys(ct::Accumulator) = keys(ct.map) - Base.values(ct::Accumulator) = values(ct.map) Base.sum(ct::Accumulator) = sum(values(ct.map)) diff --git a/src/circular_buffer.jl b/src/circular_buffer.jl index 45fd88bce..bab84e39e 100644 --- a/src/circular_buffer.jl +++ b/src/circular_buffer.jl @@ -154,8 +154,6 @@ Return the number of elements currently in the buffer. """ Base.length(cb::CircularBuffer) = cb.length -Base.eltype(::Type{CircularBuffer{T}}) where T = T - """ size(cb::CircularBuffer) @@ -163,8 +161,6 @@ Return a tuple with the size of the buffer. """ Base.size(cb::CircularBuffer) = (length(cb),) -Base.convert(::Type{Array}, cb::CircularBuffer{T}) where {T} = T[x for x in cb] - """ isempty(cb::CircularBuffer) From 91a76c963e7ad3864729b6ce63aebc581cc53031 Mon Sep 17 00:00:00 2001 From: JamesWrigley Date: Fri, 12 Apr 2024 13:49:31 +0200 Subject: [PATCH 2/2] Bump version to 0.18.19 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ed958efa3..a0aea6a93 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "DataStructures" uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" -version = "0.18.18" +version = "0.18.19" [deps] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"