Skip to content

Commit

Permalink
improve performance for non-missings
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Nov 26, 2018
1 parent c0f3f61 commit b4e8089
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
seen = falses(length(levels(src))) # needed as we have to dynamically collect levels
@inbounds for i in 0:n-1
s = srefs[sstart+i]
if s == 0
if eltype(src) >: Missing && s == 0
if eltype(dest) >: Missing
drefs[dstart+i] = 0
else
Expand All @@ -435,7 +435,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
if seen[s]
drefs[dstart+i] = remap[s]
else
seen[i] = true
seen[s] = true
rm = dpool.invindex[s]
remap[s] = rm
drefs[dstart+i] = rm
Expand All @@ -447,7 +447,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
seen = falses(length(levels(src))) # needed as we have to dynamically collect levels
@inbounds for i in 0:n-1
s = srefs[sstart+i]
if s == 0
if eltype(src) >: Missing && s == 0
if eltype(dest) >: Missing
drefs[dstart+i] = 0
else
Expand All @@ -457,7 +457,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
if seen[s]
drefs[dstart+i] = remap[s]
else
seen[i] = true
seen[s] = true
dest[dstart+i] = src[dstart+i]
remap[s] = drefs[dstart+i]
end
Expand Down

0 comments on commit b4e8089

Please sign in to comment.