Skip to content

Commit 5e39875

Browse files
committed
use shuffle! instead of randperm! again
1 parent 00d525a commit 5e39875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/Random/src/misc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function shuffle(rng::AbstractRNG, tup::(Tuple{Vararg{T, N}} where {T})) where {
194194
UInt
195195
end
196196
clo = @inbounds let mem = Memory{Ind}(undef, N)
197-
randperm!(rng, mem)
197+
shuffle!(rng, copyto!(mem, Base.OneTo(N))) # just use `randperm!` once it supports `Memory`
198198
let mem = mem, tup = tup
199199
function closure(i::Int)
200200
@inbounds tup[mem[i]]

0 commit comments

Comments
 (0)