diff-delta.c: Fix broken skip calculation.
A particularly bad case was HASH_LIMIT <= hash_count[i] < 2*HASH_LIMIT: in that case, only a single hash survived. For larger cases, 2*HASH_LIMIT was the actual limiting value after pruning. Signed-off-by: David Kastrup <dak@gnu.org> Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Kastrup committed
Aug 23, 2007 at 07:51 UTC
b1d884a9e3968db1fff91c2d066d871a3b8b013c
1 file changed
+1
-1
diff-delta.c
+1
-1
@@ -213,7 +213,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
213
entry = hash[i];
214
do {
215
struct index_entry *keep = entry;
216
- int skip = hash_count[i] / HASH_LIMIT / 2;
216
+ int skip = hash_count[i] / HASH_LIMIT;
217
do {
218
entry = entry->next;
219
} while(--skip && entry);