Skip to content

Commit a3b9298

Browse files
committed
1 parent bf1da59 commit a3b9298

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
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/6f0247efb4e4f128db6c35e7b10e5544263c7038
14+
[upstream]: https://github.com/vitaut/zmij/tree/6df7f2a3a8a87307d89751d0540d8be3dc08efb5
1515

1616
## Example
1717

src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,10 @@ unsafe fn write_significand17(
492492
all(target_arch = "x86_64", target_feature = "sse2", not(miri)),
493493
)))]
494494
{
495-
let start = unsafe { buffer.add(1) };
496495
// Digits/pairs of digits are denoted by letters: value = abbccddeeffgghhii.
497496
let abbccddee = (value / 100_000_000) as u32;
498497
let ffgghhii = (value % 100_000_000) as u32;
499-
buffer = unsafe { write_if(start, abbccddee / 100_000_000, has17digits) };
498+
buffer = unsafe { write_if(buffer, abbccddee / 100_000_000, has17digits) };
500499
let bcd = to_bcd8(u64::from(abbccddee % 100_000_000));
501500
unsafe {
502501
write8(buffer, bcd | ZEROS);
@@ -567,8 +566,7 @@ unsafe fn write_significand17(
567566
let a = (umul128(abbccddee, c.mul_const) >> 90) as u64;
568567
let bbccddee = abbccddee - a * hundred_million;
569568

570-
let start = unsafe { buffer.add(1) };
571-
buffer = unsafe { write_if(start, a as u32, has17digits) };
569+
buffer = unsafe { write_if(buffer, a as u32, has17digits) };
572570

573571
unsafe {
574572
let ffgghhii_bbccddee_64: uint64x1_t =
@@ -1034,7 +1032,7 @@ where
10341032
dec_exp += Float::MAX_DIGITS10 as i32 - 2 + i32::from(has17digits);
10351033
unsafe {
10361034
write_significand17(
1037-
buffer,
1035+
buffer.add(1),
10381036
dec.sig as u64,
10391037
has17digits,
10401038
#[cfg(all(target_arch = "x86_64", target_feature = "sse2", not(miri)))]

0 commit comments

Comments
 (0)