Skip to content

Commit

Permalink
Random: always use SamplerRangeFast for MersenneTwister (#27560)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet authored Jun 25, 2018
1 parent 0978251 commit 8eba7c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions stdlib/Random/src/RNGs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,8 @@ end

#### from a range

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

Expand Down
4 changes: 2 additions & 2 deletions stdlib/Random/src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ number generator, see [Random Numbers](@ref).
# Examples
```jldoctest
julia> srand(0); randstring()
"Qgt7sUOP"
"0IPrGg0J"
julia> randstring(MersenneTwister(0), 'a':'z', 6)
"oevnou"
"aszvqk"
julia> randstring("ACGT")
"TATCGGTC"
Expand Down

0 comments on commit 8eba7c4

Please sign in to comment.