Avoid CRC64 for Similarity IDs when using 256-bit hash.
This commit is contained in:
parent
a2d74dab50
commit
ae3ba0858c
1 changed files with 13 additions and 5 deletions
|
@ -1041,11 +1041,19 @@ process_blocks:
|
||||||
increment = cfg->chunk_cksum_sz / 2;
|
increment = cfg->chunk_cksum_sz / 2;
|
||||||
if (increment * sub_i > length)
|
if (increment * sub_i > length)
|
||||||
sub_i = length / increment;
|
sub_i = length / increment;
|
||||||
for (j = 0; j<sub_i; j++) {
|
if (increment/2 == sizeof (uint64_t)) {
|
||||||
crc = lzma_crc64(tgt, increment/2, 0);
|
for (j = 0; j<sub_i; j++) {
|
||||||
*((uint64_t *)sim_ck) = crc;
|
*((uint64_t *)sim_ck) = *((uint64_t *)tgt);
|
||||||
tgt += increment;
|
tgt += increment;
|
||||||
sim_ck += cfg->similarity_cksum_sz;
|
sim_ck += cfg->similarity_cksum_sz;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (j = 0; j<sub_i; j++) {
|
||||||
|
crc = lzma_crc64(tgt, increment/2, 0);
|
||||||
|
*((uint64_t *)sim_ck) = crc;
|
||||||
|
tgt += increment;
|
||||||
|
sim_ck += cfg->similarity_cksum_sz;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue