[PATCH] diff-delta.c: Fix broken skip calculation.
- From
David Kastrup <dak@gnu.org>
- Date
- Aug 23, 2007, 05:51 UTC
- Message-ID
- <85veb6iyry.fsf@lola.goethe.zz>
- In-Reply-To
- <alpine.LFD.0.999.0708222126590.16727@xanadu.home>
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.
Acked-by: Nicolas Pitre <nico@cam.org> Signed-off-by: David Kastrup <dak@gnu.org> --- diff-delta.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/diff-delta.c b/diff-delta.c index 3af5835..0dde2f2 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);
-- 1.5.3.rc2.257.gd8a21