Skip to content

Commit d4fa06d

Browse files
refactor: remove custom map for SmallVec
1 parent c2cb7eb commit d4fa06d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/small_array.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ mutable struct SmallVec{T, V <: AbstractVector{T}} <: AbstractVector{T}
139139
end
140140
end
141141

142+
function SmallVec{T, V}(x::Backing{T}) where {T, V}
143+
new{T, V}(x)
144+
end
145+
142146
function SmallVec{T, V}() where {T, V}
143147
new{T, V}(Backing{T}())
144148
end
@@ -179,12 +183,3 @@ end
179183

180184
Base.any(f::Function, x::SmallVec) = any(f, x.data)
181185
Base.all(f::Function, x::SmallVec) = all(f, x.data)
182-
function Base.map(f, x::SmallVec)
183-
inner = map(f, x.data)
184-
T = eltype(inner)
185-
if inner isa Backing
186-
return SmallVec{T, Vector{T}}(inner)
187-
else
188-
return SmallVec{T, typeof(inner)}(inner)
189-
end
190-
end

0 commit comments

Comments
 (0)