Skip to content

Commit 854a6c2

Browse files
committed
random: prevent unnecessary dynamic vector construction
1 parent ac31d99 commit 854a6c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/extras/random.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function rand(rng::AbstractRNG, ::Random.SamplerTrivial{Random.CloseOpen01{DoubleFloat{T}}}) where {T<:IEEEFloat}
2-
hi, lo = rand(rng, T, 2)
2+
hi = rand(rng, T)
3+
lo = rand(rng, T)
34
if hi === zero(T)
45
if lo === zero(T)
56
return zero(DoubleFloat(T))

0 commit comments

Comments
 (0)