Skip to content

Commit

Permalink
Replace 'decode' terminology with 'render'
Browse files Browse the repository at this point in the history
"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.
  • Loading branch information
dtolnay committed Nov 20, 2024
1 parent 535f396 commit daf766b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 {
Expand Down

0 comments on commit daf766b

Please sign in to comment.