Skip to content

Commit

Permalink
fix not passing rng in some shuffle! functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar committed Jan 6, 2024
1 parent 5a254ea commit 3d42dfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UnweightedSamplingMulti.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function reservoir_sample(rng, iter, n::Int, ::Val{false}, ::Val{false})
reservoir[1] = el
for i in 2:n
it = iterate(iter, state)
isnothing(it) && return shuffle!(reservoir[1:i-1])
isnothing(it) && return shuffle!(rng, reservoir[1:i-1])
el, state = it
@inbounds reservoir[i] = el
end
Expand Down Expand Up @@ -206,7 +206,7 @@ function sortedindices_sample(rng, iter, n::Int, N::Int, replace, ordered)
if ordered
return reservoir
else
return shuffle!(reservoir)
return shuffle!(rng, reservoir)
end
end
end
Expand Down

0 comments on commit 3d42dfd

Please sign in to comment.