summaryrefslogtreecommitdiffstats
path: root/diffcore-delta.c
diff options
context:
space:
mode:
Diffstat (limited to 'diffcore-delta.c')
-rw-r--r--diffcore-delta.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diffcore-delta.c b/diffcore-delta.c
index 18d8f766d7..0b45f64400 100644
--- a/diffcore-delta.c
+++ b/diffcore-delta.c
@@ -159,6 +159,10 @@ static struct spanhash_top *hash_chars(struct repository *r,
n = 0;
accum1 = accum2 = 0;
}
+ if (n > 0) {
+ hashval = (accum1 + accum2 * 0x61) % HASHBASE;
+ hash = add_spanhash(hash, hashval, n);
+ }
QSORT(hash->data, (size_t)1ul << hash->alloc_log2, spanhash_cmp);
return hash;
}