bzip2: small simplification in mainSort()

function                                             old     new   delta
mainSort                                            1127    1118      -9

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-02-03 18:11:08 +01:00
parent fe1bab4d35
commit 9431bdd189

View File

@ -833,13 +833,13 @@ void mainSort(EState* state,
/*h = h / 3;*/ /*h = h / 3;*/
h = (h * 171) >> 9; /* bbox: fast h/3 */ h = (h * 171) >> 9; /* bbox: fast h/3 */
for (i = h; i <= 255; i++) { for (i = h; i <= 255; i++) {
unsigned vv; unsigned vv, jh;
vv = runningOrder[i]; /* uint8[] */ vv = runningOrder[i]; /* uint8[] */
j = i; j = i;
while (BIGFREQ(runningOrder[j-h]) > BIGFREQ(vv)) { while (jh = j - h, BIGFREQ(runningOrder[jh]) > BIGFREQ(vv)) {
runningOrder[j] = runningOrder[j-h]; runningOrder[j] = runningOrder[jh];
j = j - h; j = jh;
if (j <= (h - 1)) if (j < h)
break; break;
} }
runningOrder[j] = vv; runningOrder[j] = vv;