Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
  • Loading branch information
bkamins and nalimilan committed Nov 7, 2020
1 parent d88d0cd commit 114eddc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dataframerow/utils.jl
Expand Up @@ -43,8 +43,8 @@ function hashrows_col!(h::Vector{UInt},
firstcol::Bool)
# When hashing the first column, no need to take into account previous hash,
# which is always zero
# also when there are more than 90% of refs in the pool than the length of the
# vector avoid using this path. 90% is picked heuristically
# also when the number of values in the pool is more than half the length
# of the vector avoid using this path. 50% is roughly based on benchmarks
if firstcol && 2 * length(rp) < length(v)
hashes = Vector{UInt}(undef, length(rp))
@inbounds for (i, v) in zip(eachindex(hashes), rp)
Expand Down
2 changes: 1 addition & 1 deletion test/grouping.jl
Expand Up @@ -3174,7 +3174,7 @@ end
end

@testset "hashing of pooled vectors" begin
# test both hashrow calculation paths - the of pool length thereshold is 50%
# test both hashrow calculation paths - the of pool length threshold is 50%
for x in ([1:9; fill(1, 101)], [1:100;],
[1:9; fill(missing, 101)], [1:99; missing])
x1 = PooledArray(x);
Expand Down

0 comments on commit 114eddc

Please sign in to comment.