DataStructures.jl icon indicating copy to clipboard operation
DataStructures.jl copied to clipboard

Fix CircularBuffer inner constructor

Open rossviljoen opened this issue 4 months ago • 2 comments

rossviljoen avatar Aug 20 '25 12:08 rossviljoen

What is this fixing? Can it have a test added that was failing before and now passes?

oxinabox avatar Aug 27 '25 04:08 oxinabox

Nothing was actually broken before. The issue is that there is an inner constructor: CircularBuffer{T}(f::Integer, len::Integer, buf::Integer) where {T} = CircularBuffer{T}(Int(f), Int(len), Int(buf)) which is incorrect, since buf is never an Integer/Int.

This constructor was already superfluous because of https://github.com/JuliaCollections/DataStructures.jl/pull/893#discussion_r1469114908 , so there's no change in behaviour, but this PR just implements the original intention in that linked PR.

rossviljoen avatar Aug 27 '25 08:08 rossviljoen