lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] lib/vsprintf.c: Simplify uuid_string()
From
Date
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];




\
 
 \ /
  Last update: 2015-05-11 19:21    [W:0.099 / U:18.612 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site