Skip to content

Commit

Permalink
delta micro optimization
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Feb 10, 2006
1 parent e7ad4a9 commit 39556fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions delta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 39556fb

Please sign in to comment.