We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a19119 commit 4d210c3Copy full SHA for 4d210c3
src/lib.rs
@@ -537,7 +537,11 @@ unsafe fn encode_impl(
537
538
while digit_index < digits {
539
write_idx = write_idx.wrapping_sub(1);
540
- *buf.get_unchecked_mut(write_idx) = *encode_table.get_unchecked((u64_num % BASE) as usize);
+
541
+ let quotient = u64_num / BASE;
542
+ let remainder = u64_num - quotient * BASE;
543
544
+ *buf.get_unchecked_mut(write_idx) = *encode_table.get_unchecked(remainder as usize);
545
546
digit_index = digit_index.wrapping_add(1);
547
match digit_index {
@@ -546,7 +550,7 @@ unsafe fn encode_impl(
550
num /= BASE_TO_10;
551
}
548
552
20 => u64_num = num as u64,
549
- _ => u64_num /= BASE,
553
+ _ => u64_num = quotient,
554
555
556
0 commit comments