From 7f5965ff7f644c1e26da4afb6adca9b327fd1be7 Mon Sep 17 00:00:00 2001 From: Jeremiah Lewis <4462211+jeremiahpslewis@users.noreply.github.com> Date: Wed, 27 Mar 2024 19:17:24 +0100 Subject: [PATCH] use function --- src/CircularArrayBuffers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CircularArrayBuffers.jl b/src/CircularArrayBuffers.jl index 4aae717..c8a0520 100644 --- a/src/CircularArrayBuffers.jl +++ b/src/CircularArrayBuffers.jl @@ -124,7 +124,7 @@ function Base.empty!(cb::CircularArrayBuffer) end function Base.push!(cb::CircularArrayBuffer{T,N}, data) where {T,N} - if cb.nframes == capacity(cb) + if isfull(cb) cb.first = (cb.first == capacity(cb) ? 1 : cb.first + 1) else cb.nframes += 1