Pick up 4-characters-at-a-time fix from libcore

b0e55a83a8
This commit is contained in:
David Tolnay 2017-09-16 14:19:18 -07:00
parent 35106024c6
commit 37d2fda49b
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
1 changed files with 3 additions and 2 deletions

View File

@ -65,8 +65,9 @@ macro_rules! impl_Integer {
let lut_ptr = DEC_DIGITS_LUT.as_ptr(); let lut_ptr = DEC_DIGITS_LUT.as_ptr();
unsafe { unsafe {
// need at least 16 bits for the 4-characters-at-a-time to work.
if mem::size_of::<$t>() >= 2 {
// eagerly decode 4 characters at a time // eagerly decode 4 characters at a time
if <$t>::max_value() as u64 >= 10000 {
while n >= 10000 { while n >= 10000 {
let rem = (n % 10000) as isize; let rem = (n % 10000) as isize;
n /= 10000; n /= 10000;