Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
delta micro optimization
author
Nicolas Pitre
<nico@cam.org>
Fri, 10 Feb 2006 18:42:05 +0000
(13:42 -0500)
committer
Junio C Hamano
<junkio@cox.net>
Fri, 10 Feb 2006 19:42:56 +0000
(11:42 -0800)
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>
delta.h
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
e7ad4a9
)
diff --git
a/delta.h
b/delta.h
index 31d1820f80f2887d51808170fc86585ada42d42e..a15350dabcd497d4cb21261721706eca072de034 100644
(file)
--- a/
delta.h
+++ b/
delta.h
@@
-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 & ~0x8
0;
- 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;
}