Skip to content

Commit 1df417e

Browse files
committed
fix cmdlineargs tests, and minor updates
1 parent 6853915 commit 1df417e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

stdlib/Random/src/generation.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,15 +375,14 @@ function rand(rng::AbstractRNG, sp::SamplerRangeNDL{U,T}) where {U,T}
375375
s = sp.s
376376
x = widen(rand(rng, U))
377377
m = x * s
378-
r = (m % U) < s ? rand_unlikely(rng, s, m) % T :
379-
iszero(s) ? x % T :
380-
(m >> (8*sizeof(U))) % T
378+
r::T = (m % U) < s ? rand_unlikely(rng, s, m) % T :
379+
iszero(s) ? x % T :
380+
(m >> (8*sizeof(U))) % T
381381
r + sp.a
382382
end
383383

384-
# similar to `randn_unlikely` : splitting out this unlikely path leads to faster code
384+
# similar to `randn_unlikely` : splitting this unlikely path out results in faster code
385385
@noinline function rand_unlikely(rng, s::U, m)::U where {U}
386-
# m needs to be passed, because the while loop below might have no iterations
387386
t = mod(-s, s) # as s is unsigned, -s is equal to 2^L - s in the paper
388387
while (m % U) < t
389388
x = widen(rand(rng, U))

test/testhelpers/coverage_file.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SF:<FILENAME>
22
DA:3,1
3-
DA:4,1
3+
DA:4,2
44
DA:5,0
55
DA:7,1
66
DA:8,1

0 commit comments

Comments
 (0)