Skip to content

Commit cacaaac

Browse files
committed
1 parent 2fb3e09 commit cacaaac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ numbers to decimal strings.
1111
This Rust implementation is a line-by-line port of Victor Zverovich's
1212
implementation in C++, [https://github.com/vitaut/zmij][upstream].
1313

14-
[upstream]: https://github.com/vitaut/zmij/tree/4c788ff56e2bf6ad7dba15a98f15d65f96f8f1d4
14+
[upstream]: https://github.com/vitaut/zmij/tree/2bf93b1b8e256dd89e8eafe3ed247e4d4c8cfd47
1515

1616
## Example
1717

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn count_trailing_nonzeros(x: u64) -> usize {
398398
// bit is unused we can avoid the zero check by shifting the datum left by
399399
// one and inserting a sentinel bit at the end. This can be faster than the
400400
// automatically inserted range check.
401-
(70 - ((x.to_le() << 1) | 1).leading_zeros()) as usize / 8
401+
(70 - ((x.to_le() << 1) | 1).leading_zeros() as usize) / 8
402402
}
403403

404404
// Align data since unaligned access may be slower when crossing a
@@ -699,10 +699,10 @@ unsafe fn write_significand17(mut buffer: *mut u8, value: u64, has17digits: bool
699699
// non-zero digit is the last digit which we factored off. But in
700700
// that case the number would be printed with a different exponent
701701
// that shifts the last digit into the first position.
702-
let len = 32 - u32::from(mask).leading_zeros();
702+
let len = 32 - u32::from(mask).leading_zeros() as usize;
703703

704704
_mm_storeu_si128(buffer.cast::<__m128i>(), digits);
705-
buffer.add(if last_digit != 0 { 17 } else { len as usize })
705+
buffer.add(if last_digit != 0 { 17 } else { len })
706706
}
707707
}
708708

0 commit comments

Comments
 (0)