Skip to content

Commit

Permalink
diff-delta.c: Fix broken skip calculation.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Nicolas Pitre <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
dakhubgit authored and gitster committed Aug 23, 2007
1 parent 59fc840 commit b1d884a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff-delta.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b1d884a

Please sign in to comment.