Skip to content

Commit cde2b95

Browse files
committed
de-hardcode typemax(UInt8)
1 parent d2262c8 commit cde2b95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/Random/src/misc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ ltm52(n::Int, mask::Int=nextpow(2, n)-1) = LessThan(n-1, Masked(mask, UInt52Raw(
185185

186186
function shuffle(rng::AbstractRNG, tup::(Tuple{Vararg{T, N}} where {T})) where {N}
187187
@inline let # `@inline` and `@inbounds` are here to help escape analysis
188-
Ind = (N <= 0xff) ? UInt8 : UInt16 # use a narrow integer type to save stack space and prevent heap allocation
188+
Ind = (N <= typemax(UInt8)) ? UInt8 : UInt16 # use a narrow integer type to save stack space and prevent heap allocation
189189
clo = @inbounds let mem = Memory{Ind}(undef, N)
190190
randperm!(rng, mem)
191191
let mem = mem, tup = tup

0 commit comments

Comments
 (0)