From 095ea81267601b31823c92988ff17ddb97e70918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Thu, 12 Aug 2021 18:50:32 +0200 Subject: [PATCH] avoid calling f twice (#70) --- src/PooledArrays.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PooledArrays.jl b/src/PooledArrays.jl index cb662b2..9997717 100644 --- a/src/PooledArrays.jl +++ b/src/PooledArrays.jl @@ -325,7 +325,7 @@ function Base.map(f, x::PooledArray{T,R}) where {T,R<:Integer} end refarray = map(x->translate[x], x.refs) else - newinvpool = Dict(zip(map(f, ks), vs)) + newinvpool = Dict(zip(ks1, vs)) refarray = copy(x.refs) end return PooledArray(RefArray(refarray), newinvpool)