From da410ca4f1ba1e21af37c4886847210950e36ce1 Mon Sep 17 00:00:00 2001 From: Jeremiah Lewis <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 27 Mar 2024 21:38:30 +0100 Subject: [PATCH] tweak types --- src/CircularArrayBuffers.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/CircularArrayBuffers.jl b/src/CircularArrayBuffers.jl index b2ad6d5..659e5d7 100644 --- a/src/CircularArrayBuffers.jl +++ b/src/CircularArrayBuffers.jl @@ -137,13 +137,14 @@ function Base.push!(cb::CircularArrayBuffer{T,N}, data) where {T,N} return cb end -function Base.push!(cb::CircularArrayBuffer{T,1}, data) where {T} +function Base.push!(cb::CircularVectorBuffer{T}, data) where {T} _update_first_and_nframes!(cb) i = _buffer_frame(cb, cb.nframes) cb.buffer[i:i] .= Ref(data) + return cb end -function Base.append!(cb::CircularArrayBuffer{T,N}, data::D) where {T,N,D} +function Base.append!(cb::CircularArrayBuffer{T,N}, data) where {T,N} d, r = divrem(length(data), cb.step_size) @assert r == 0 if length(data) >= length(cb.buffer) @@ -185,7 +186,7 @@ function Base.pop!(cb::CircularArrayBuffer{T,N}) where {T,N} else res = @views cb.buffer[ntuple(_ -> (:), N - 1)..., _buffer_frame(cb, cb.nframes)] cb.nframes -= 1 - res + return res end end @@ -199,7 +200,7 @@ function Base.popfirst!(cb::CircularArrayBuffer{T,N}) where {T,N} if cb.first > capacity(cb) cb.first = 1 end - res + return res end end