Skip to content

Commit 16c93a4

Browse files
committed
Fix CircularBuffer inner constructor
1 parent b7c5a51 commit 16c93a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/circular_buffer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ mutable struct CircularBuffer{T} <: AbstractVector{T}
1414
length::Int
1515
buffer::Vector{T}
1616

17-
function CircularBuffer{T}(f,len,buf) where {T}
17+
function CircularBuffer{T}(f::Int, len::Int, buf) where {T}
1818
f <= length(buf) || throw(ArgumentError("Value of 'first' must be inbounds of buffer"))
1919
len <= length(buf) || throw(ArgumentError("Value of 'length' must be <= length of buffer"))
2020
return new{T}(length(buf), f, len, buf)
2121
end
2222

2323
# Convert any `Integer` to whatever `Int` is on the relevant machine
24-
CircularBuffer{T}(f::Integer, len::Integer, buf::Integer) where {T} = CircularBuffer{T}(Int(f), Int(len), Int(buf))
24+
CircularBuffer{T}(f::Integer, len::Integer, buf) where {T} = CircularBuffer{T}(Int(f), Int(len), buf)
2525
end
2626

2727
function CircularBuffer{T}(iter, capacity::Integer) where {T}

0 commit comments

Comments
 (0)