Skip to content

Commit

Permalink
do not splat pairs passed to _recode!
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Nov 28, 2024
1 parent 74123a6 commit 15a09db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/recode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function recode!(dest::AbstractArray, src::AbstractArray, default::Any, pairs::P

opt_pairs = optimize_pair.(pairs)

_recode!(dest, src, default, opt_pairs...)
_recode!(dest, src, default, opt_pairs)
end

function _recode!(dest::AbstractArray{T}, src::AbstractArray, default, pairs...) where {T}
function _recode!(dest::AbstractArray{T}, src::AbstractArray, default, pairs) where {T}
recode_to = last.(pairs)
recode_from = first.(pairs)

Expand Down Expand Up @@ -100,7 +100,7 @@ function _recode!(dest::AbstractArray{T}, src::AbstractArray, default, pairs...)
dest
end

function _recode!(dest::CategoricalArray{T, <:Any, R}, src::AbstractArray, default::Any, pairs...) where {T, R}
function _recode!(dest::CategoricalArray{T, <:Any, R}, src::AbstractArray, default::Any, pairs) where {T, R}
recode_to = last.(pairs)
recode_from = first.(pairs)

Expand Down Expand Up @@ -168,7 +168,7 @@ function _recode!(dest::CategoricalArray{T, <:Any, R}, src::AbstractArray, defau
end

function _recode!(dest::CategoricalArray{T, N, R}, src::CategoricalArray,
default::Any, pairs::Pair...) where {T, N, R<:Integer}
default::Any, pairs::Tuple) where {T, N, R<:Integer}
vals = T[p.second for p in pairs]
if default === nothing
srclevels = levels(src)
Expand Down

0 comments on commit 15a09db

Please sign in to comment.