提交 39556fbd 编写于 作者: N Nicolas Pitre 提交者: Junio C Hamano

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: NNicolas Pitre <nico@cam.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 e7ad4a9c
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册