From bc8ebd8e5481fdaeac4026666ba0c0deb2a721eb Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Fri, 14 Nov 2025 10:21:07 -0500 Subject: [PATCH] loading.jl: Make `slug` internally type-stable The call to `divrem` used to change the type of `x` (previously `y`) from `UInt32` to `UInt64` on 64-bit systems. Avoid this. (No externally visible change.) --- base/loading.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 2eac9d06ca66e..18b26794116ce 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -185,10 +185,9 @@ const slug_chars = String(['A':'Z'; 'a':'z'; '0':'9']) function slug(x::UInt32, p::Int) sprint(sizehint=p) do io - y = x - n = length(slug_chars) + n = UInt32(length(slug_chars)) for i = 1:p - y, d = divrem(y, n) + x, d = divrem(x, n) write(io, slug_chars[1+d]) end end