bzip2: eliminate some divisions

This commit is contained in:
Denis Vlasenko
2007-10-14 07:49:48 +00:00
parent 3f5fdc7572
commit 6a9154b6f6
3 changed files with 51 additions and 35 deletions

View File

@@ -183,6 +183,8 @@ void BZ2_hbMakeCodeLengths(uint8_t *len,
for (i = 1; i <= alphaSize; i++) {
j = weight[i] >> 8;
/* bbox: yes, it is a signed division.
* don't replace with shift! */
j = 1 + (j / 2);
weight[i] = j << 8;
}