Skip to content

Commit

Permalink
Fix more specialize locations
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
  • Loading branch information
timholy and aviatesk authored Dec 14, 2022
1 parent 1bb1f1b commit a0553a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ union!(v::AbstractVector{T}, itrs...) where {T} =
symdiff!(v::AbstractVector{T}, itrs...) where {T} =
_grow!(_shrink_filter!(symdiff!(Set{T}(), v, itrs...)), v, itrs)

function _shrink!(shrinker!::F, v::AbstractVector, itrs) where F
function _shrink!(@specialize(shrinker!), v::AbstractVector, itrs)
seen = Set{eltype(v)}()
filter!(_grow_filter!(seen), v)
shrinker!(seen, itrs...)
Expand All @@ -2768,7 +2768,7 @@ setdiff!( v::AbstractVector, itrs...) = _shrink!(setdiff!, v, itrs)

vectorfilter(T::Type, f, v) = T[x for x in v if f(x)]

function _shrink(shrinker!::F, itr, itrs) where F
function _shrink(@specialize(shrinker!), itr, itrs)
T = promote_eltype(itr, itrs...)
keep = shrinker!(Set{T}(itr), itrs...)
vectorfilter(T, _shrink_filter!(keep), itr)
Expand Down

0 comments on commit a0553a9

Please sign in to comment.