Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Nov 26, 2018
1 parent e6a51fa commit ff08d35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
(dstart destinds && dstart+n-1 destinds) || throw(BoundsError(dest, dstart:dstart+n-1))
(sstart srcinds && sstart+n-1 srcinds) || throw(BoundsError(src, sstart:sstart+n-1))

drefs = CategoricalArrays.refs(dest)
srefs = CategoricalArrays.refs(src)
dpool = CategoricalArrays.pool(dest)
spool = CategoricalArrays.pool(src)
drefs = refs(dest)
srefs = refs(src)
dpool = pool(dest)
spool = pool(src)

if isordered(dest)
remap = Vector{eltype(drefs)}(undef, length(levels(src)))
Expand All @@ -432,7 +432,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
throw(MissingException("cannot copy array with missing values to an array with element type $T"))
end
else
if !seen[s]
if seen[s]
drefs[dstart+i] = remap[s]
else
seen[i] = true
Expand All @@ -454,7 +454,7 @@ function copyto!(dest::CatArrOrSub, dstart::Integer,
throw(MissingException("cannot copy array with missing values to an array with element type $T"))
end
else
if !seen[s]
if seen[s]
drefs[dstart+i] = remap[s]
else
seen[i] = true
Expand Down Expand Up @@ -701,7 +701,7 @@ function Base.push!(A::CategoricalVector, item)
A
end

function Base.append!(A::CategoricalVector, B::AbstractArary)
function Base.append!(A::CategoricalVector, B::AbstractArray)
len = length(A)
len2 = length(B)
resize!(A.refs, len + len2)
Expand Down

0 comments on commit ff08d35

Please sign in to comment.