Skip to content

Commit

Permalink
fix performance in printf (#28670)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Aug 16, 2018
1 parent 5c1f6b0 commit 4629a21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/printf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ function decode_oct(d::Integer)
@handle_zero x digits
pt = i = div((sizeof(x)<<3)-leading_zeros(x)+2,3)
while i > 0
digits[i] = '0'+(x&0x7)
digits[i] = 48+(x&0x7)
x >>= 3
i -= 1
end
Expand All @@ -876,7 +876,7 @@ function decode_0ct(d::Integer)
pt = i = div((sizeof(x)<<3)-leading_zeros(x)+5,3)
digits = DIGITSs[Threads.threadid()]
while i > 0
digits[i] = '0'+(x&0x7)
digits[i] = 48+(x&0x7)
x >>= 3
i -= 1
end
Expand All @@ -889,7 +889,7 @@ function decode_dec(d::Integer)
@handle_zero x digits
pt = i = Base.ndigits0z(x)
while i > 0
digits[i] = '0'+rem(x,10)
digits[i] = 48+rem(x,10)
x = div(x,10)
i -= 1
end
Expand Down

0 comments on commit 4629a21

Please sign in to comment.