Messages in this thread | | | Subject | Re: [RFC PATCH] lib/vsprintf.c: Simplify uuid_string() | From | Joe Perches <> | Date | Mon, 11 May 2015 09:49:23 -0700 |
| |
On Mon, 2015-05-11 at 12:32 -0400, George Spelvin wrote: > I suspect it's a speedup, but since this is not hot code, the important > part is that it shrinks the function from 332 to 256 bytes.
shrinking code in vsprintf is always good
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > for (i = 0; i < 16; i++) { > - p = hex_byte_pack(p, addr[index[i]]); > + u8 byte = addr[index[i]]; > + *p++ = hex[x >> 4]; > + *p++ = hex[x & 0x0f];
? *p++ = hex[byte >> 4]; *p++ = hex[byte & 0x0f];
| |