Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330064
b: refs/heads/master
c: cb239d0
h: refs/heads/master
v: v3
  • Loading branch information
George Spelvin authored and Linus Torvalds committed Oct 5, 2012
1 parent d8d36e1 commit 82cfde8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2359172a75986359ce9cf041a9aca6a32cdf8779
refs/heads/master: cb239d0a97d573150d6106a92c0641da0d03f6a1
22 changes: 6 additions & 16 deletions trunk/lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,12 @@ char *put_dec_trunc8(char *buf, unsigned r)
unsigned q;

/* Copy of previous function's body with added early returns */
q = (r * (uint64_t)0x1999999a) >> 32;
*buf++ = (r - 10 * q) + '0'; /* 2 */
if (q == 0)
return buf;
r = (q * (uint64_t)0x1999999a) >> 32;
*buf++ = (q - 10 * r) + '0'; /* 3 */
if (r == 0)
return buf;
q = (r * (uint64_t)0x1999999a) >> 32;
*buf++ = (r - 10 * q) + '0'; /* 4 */
if (q == 0)
return buf;
r = (q * (uint64_t)0x1999999a) >> 32;
*buf++ = (q - 10 * r) + '0'; /* 5 */
if (r == 0)
return buf;
while (r >= 10000) {
q = r + '0';
r = (r * (uint64_t)0x1999999a) >> 32;
*buf++ = q - 10*r;
}

q = (r * 0x199a) >> 16;
*buf++ = (r - 10 * q) + '0'; /* 6 */
if (q == 0)
Expand Down

0 comments on commit 82cfde8

Please sign in to comment.