summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3dc5a9e)
raw | patch | inline | side by side (parent: 3dc5a9e)
author | Nicolas Pitre <nico@cam.org> | |
Wed, 3 May 2006 03:46:51 +0000 (23:46 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 3 May 2006 04:32:32 +0000 (21:32 -0700) |
This is my assembly freak side looking at generated code again. And
since create_delta() is certainly pretty high on the radar every bits
count. In this case shorter code is generated if hash_mask is not
copied to a local variable.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
since create_delta() is certainly pretty high on the radar every bits
count. In this case shorter code is generated if hash_mask is not
copied to a local variable.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff-delta.c | patch | blob | history |
diff --git a/diff-delta.c b/diff-delta.c
index 35e517d2d79002214988b57b476faa29f8292394..45df786b0a099e03bcca57f40047be04635e130d 100644 (file)
--- a/diff-delta.c
+++ b/diff-delta.c
const void *trg_buf, unsigned long trg_size,
unsigned long *delta_size, unsigned long max_size)
{
- unsigned int i, outpos, outsize, hash_mask, val;
+ unsigned int i, outpos, outsize, val;
int inscnt;
const unsigned char *ref_data, *ref_top, *data, *top;
unsigned char *out;
ref_top = ref_data + index->src_size;
data = trg_buf;
top = trg_buf + trg_size;
- hash_mask = index->hash_mask;
outpos++;
val = 0;
struct index_entry *entry;
val ^= U[data[-RABIN_WINDOW]];
val = ((val << 8) | *data) ^ T[val >> RABIN_SHIFT];
- i = val & hash_mask;
+ i = val & index->hash_mask;
for (entry = index->hash[i]; entry; entry = entry->next) {
const unsigned char *ref = entry->ptr;
const unsigned char *src = data;