diff options
author | Nicolas Pitre <nico@cam.org> | 2006-02-10 13:42:05 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-02-10 11:42:56 -0800 |
commit | 39556fbdadaacf67330bc1464e0172468e9c3a5e (patch) | |
tree | e63d2249b68742a5619937e0cab0b4c4b41bd5a6 /delta.h | |
parent | e7ad4a9c3c9d383d1df52410e18808174f7be667 (diff) | |
download | git-39556fbdadaacf67330bc1464e0172468e9c3a5e.tar.gz |
delta micro optimization
My kernel work habit made me look at the generated assembly for the
delta code, and one obvious albeit small improvement is this patch.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'delta.h')
-rw-r--r-- | delta.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -19,14 +19,14 @@ extern void *patch_delta(void *src_buf, unsigned long src_size, static inline unsigned long get_delta_hdr_size(const unsigned char **datap) { const unsigned char *data = *datap; - unsigned char cmd = *data++; - unsigned long size = cmd & ~0x80; - int i = 7; - while (cmd & 0x80) { + unsigned char cmd; + unsigned long size = 0; + int i = 0; + do { cmd = *data++; size |= (cmd & ~0x80) << i; i += 7; - } + } while (cmd & 0x80); *datap = data; return size; } |