Skip to content

Commit

Permalink
Merge pull request JuliaLang#9626 from jlapeyre/jl/rngspeed
Browse files Browse the repository at this point in the history
add @inline so that rand(Bool) is inlined
  • Loading branch information
Viral B. Shah committed Jan 5, 2015
2 parents d877d63 + b1b9122 commit dab6b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/random.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ rand(r::Union(RandomDevice,MersenneTwister), ::Type{Float32}) =

# MersenneTwister

rand{T<:Union(Bool, Int8, UInt8, Int16, UInt16, Int32, UInt32)}(r::MersenneTwister, ::Type{T}) = rand_ui52_raw(r) % T
@inline rand{T<:Union(Bool, Int8, UInt8, Int16, UInt16, Int32, UInt32)}(r::MersenneTwister, ::Type{T}) = rand_ui52_raw(r) % T

function rand(r::MersenneTwister, ::Type{UInt64})
reserve(r, 2)
Expand Down

0 comments on commit dab6b5e

Please sign in to comment.