Skip to content

Commit 4547192

Browse files
feat: implement sizehint! for SmallVec
1 parent 642debb commit 4547192

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/small_array.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,9 @@ function Base.push!(x::SmallVec{T, V}, v) where {T, V}
125125
end
126126

127127
Base.pop!(x::SmallVec) = pop!(x.data)
128+
129+
function Base.sizehint!(x::SmallVec{T, V}, n; kwargs...) where {T, V}
130+
x.data isa Backing && return x
131+
sizehint!(x.data, n; kwargs...)
132+
x
133+
end

0 commit comments

Comments
 (0)