X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diffcore-delta.c;h=d9729e5ec27d2ff2bacf4ed930195f9293f8ca5a;hb=c2a33679a726aeb75529540c2b295f21023ddbc7;hp=7116df0b83f68b9d31dc8e4c3a89ad365a138a37;hpb=af3abef94af9c821a0c192c693c3e5342ab8729f;p=git.git diff --git a/diffcore-delta.c b/diffcore-delta.c index 7116df0b8..d9729e5ec 100644 --- a/diffcore-delta.c +++ b/diffcore-delta.c @@ -122,11 +122,14 @@ static struct spanhash_top *add_spanhash(struct spanhash_top *top, } } -static struct spanhash_top *hash_chars(unsigned char *buf, unsigned int sz) +static struct spanhash_top *hash_chars(struct diff_filespec *one) { int i, n; unsigned int accum1, accum2, hashval; struct spanhash_top *hash; + unsigned char *buf = one->data; + unsigned int sz = one->size; + int is_text = !diff_filespec_is_binary(one); i = INITIAL_HASH_SIZE; hash = xmalloc(sizeof(*hash) + sizeof(struct spanhash) * (1<> 25); accum2 = (accum2 << 7) ^ (old_1 >> 25); accum1 += c; @@ -169,14 +177,14 @@ int diffcore_count_changes(struct diff_filespec *src, if (src_count_p) src_count = *src_count_p; if (!src_count) { - src_count = hash_chars(src->data, src->size); + src_count = hash_chars(src); if (src_count_p) *src_count_p = src_count; } if (dst_count_p) dst_count = *dst_count_p; if (!dst_count) { - dst_count = hash_chars(dst->data, dst->size); + dst_count = hash_chars(dst); if (dst_count_p) *dst_count_p = dst_count; }