Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faster rand(::Tuple) #32208

Merged
merged 2 commits into from
Sep 27, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
faster rand(::MersenneTwister, ::OneTo)
This was an oversight.
This makes rand(::MersenneTwister, ::Tuple) generally faster.
  • Loading branch information
rfourquet committed Sep 27, 2019
commit 59b56ce1beff537b82aca6db4b2a5e6ccea6713a
2 changes: 1 addition & 1 deletion stdlib/Random/src/RNGs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ end
#### from a range

for T in BitInteger_types, R=(1, Inf) # eval because of ambiguity otherwise
@eval Sampler(::Type{MersenneTwister}, r::UnitRange{$T}, ::Val{$R}) =
@eval Sampler(::Type{MersenneTwister}, r::AbstractUnitRange{$T}, ::Val{$R}) =
SamplerRangeFast(r)
end

Expand Down