From b1d884a9e3968db1fff91c2d066d871a3b8b013c Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Thu, 23 Aug 2007 07:51:45 +0200 Subject: 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 Acked-by: Nicolas Pitre Signed-off-by: Junio C Hamano --- diff-delta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'diff-delta.c') diff --git a/diff-delta.c b/diff-delta.c index 3af583536f..0dde2f2dc0 100644 --- a/diff-delta.c +++ b/diff-delta.c @@ -213,7 +213,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize) entry = hash[i]; do { struct index_entry *keep = entry; - int skip = hash_count[i] / HASH_LIMIT / 2; + int skip = hash_count[i] / HASH_LIMIT; do { entry = entry->next; } while(--skip && entry); -- cgit v1.2.3