mirror of
https://github.com/google/brotli.git
synced 2024-11-26 13:20:06 +00:00
Remove unnecessary branch from literal cost calculation.
This commit is contained in:
parent
76dd31e6d6
commit
b6689b1504
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user