We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
randperm!
Memory
1 parent 6ebd824 commit d1ea278Copy full SHA for d1ea278
stdlib/Random/src/misc.jl
@@ -203,8 +203,7 @@ function shuffle(rng::AbstractRNG, tup::NTuple{N}) where {N}
203
else
204
UInt
205
end
206
- # TODO: use `randperm!` instead of `copyto!` from a unit range once `randperm!` supports `Memory`
207
- mem = @inbounds shuffle!(rng, copyto!(Memory{Ind}(undef, N), Base.OneTo(N)))
+ mem = @inbounds randperm!(rng, Memory{Ind}(undef, N))
208
function closure(i::Int)
209
@inbounds tup[mem[i]]
210
0 commit comments