You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#TODO: to get the best performance we need to avoid reallocating these.
# This algorithm actually works in place, unless the dict is modified
# due to GC during this process.
newkeys =similar(keys, count0)
newvals =similar(vals, count0)
@inboundsfor from =1:length(keys)
if!ptrs ||isassigned(keys, from)
k = keys[from]
hashk =hash(k)%Int
isdeleted =false
if!ptrs
iter =0
The first check (!ptrs || isassigned(keys, from)) can be just isassigned(keys, from) (these should be the same, since isbits arrays are always assigned)
The second check should now use Base.isbitsunion (and perhaps isassigned(values, from) too as an optimization)
The text was updated successfully, but these errors were encountered:
vtjnash
changed the title
problem with
problem with isbitstype usage after union-splitting optim
Dec 20, 2019
OrderedCollections.jl/src/ordered_dict.jl
Lines 136 to 149 in 1ca4dd3
The first check (
!ptrs || isassigned(keys, from)
) can be justisassigned(keys, from)
(these should be the same, since isbits arrays are always assigned)The second check should now use
Base.isbitsunion
(and perhapsisassigned(values, from)
too as an optimization)The text was updated successfully, but these errors were encountered: