Remove unnecessary branch from literal cost calculation.

This commit is contained in:
Zoltan Szabadka 2015-10-05 11:42:45 +02:00
parent 76dd31e6d6
commit b6689b1504

View File

@ -97,10 +97,8 @@ void EstimateBitCostsForLiteralsUTF8(size_t pos, size_t len, size_t mask,
}
if (i + window_half < len) {
// Add a byte in the future.
int c = (i + window_half - 1) < 0 ?
0 : data[(pos + i + window_half - 1) & mask];
int last_c = (i + window_half - 2) < 0 ?
0 : data[(pos + i + window_half - 2) & mask];
int c = data[(pos + i + window_half - 1) & mask];
int last_c = data[(pos + i + window_half - 2) & mask];
int utf8_pos2 = UTF8Position(last_c, c, max_utf8);
++histogram[utf8_pos2][data[(pos + i + window_half) & mask]];
++in_window_utf8[utf8_pos2];