There is no point using a thread on the last checksum update, nor to add the value to cksum_limit.

This commit is contained in:
Con Kolivas 2012-03-11 12:22:35 +11:00
parent 5edf8471d1
commit 704d7b5eb6

11
rzip.c
View file

@ -722,11 +722,12 @@ static bool hash_search(rzip_control *control, struct rzip_state *st, double pct
if (unlikely(!control->checksum.buf)) if (unlikely(!control->checksum.buf))
fatal_return(("Failed to malloc ckbuf in hash_search\n"), false); fatal_return(("Failed to malloc ckbuf in hash_search\n"), false);
control->do_mcpy(control, control->checksum.buf, cksum_limit, control->checksum.len); control->do_mcpy(control, control->checksum.buf, cksum_limit, control->checksum.len);
control->checksum.cksum = &st->cksum; st->cksum = CrcUpdate(st->cksum, control->checksum.buf, control->checksum.len);
cksum_update(control); if (!NO_MD5)
cksum_limit += control->checksum.len; md5_process_bytes(control->checksum.buf, control->checksum.len, &control->ctx);
} free(control->checksum.buf);
unlock_mutex(control, &control->cksumlock);
} else
wait_mutex(control, &control->cksumlock); wait_mutex(control, &control->cksumlock);
if (unlikely(!put_literal(control, st, 0, 0))) if (unlikely(!put_literal(control, st, 0, 0)))