From daf766bdd110d5174709644278df6aff1fa59424 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 20 Nov 2024 10:08:13 -0800 Subject: [PATCH] Replace 'decode' terminology with 'render' "Decode" ordinarily refers to turning a serialized representation into an in-memory representation, which is the opposite of what is happening in this code. We could say "encode" but "render" is even clearer. --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e8ffe7a..9be0fdc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -157,7 +157,7 @@ macro_rules! impl_Integer { let buf_ptr = buf.as_mut_ptr() as *mut u8; let lut_ptr = DEC_DIGITS_LUT.as_ptr(); - // Eagerly decode 4 digits at a time. + // Render 4 digits at a time. while n >= 10000 { let rem = (n % 10000) as isize; n /= 10000; @@ -174,7 +174,7 @@ macro_rules! impl_Integer { // If we reach here, numbers are <=9999 so at most 4 digits long. let mut n = n as isize; // Possibly reduce 64-bit math. - // Decode 2 more digits, if >2 digits. + // Render 2 more digits, if >2 digits. if n >= 100 { let d1 = (n % 100) << 1; n /= 100; @@ -184,7 +184,7 @@ macro_rules! impl_Integer { } } - // Decode last 1 or 2 digits. + // Render last 1 or 2 digits. if n < 10 { curr -= 1; unsafe {