Skip to content

Commit 4cf7897

Browse files
committed
Remove unnecessary test
1 parent 1ba3473 commit 4cf7897

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/entropy/EntropyUtils.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,9 @@ int EntropyUtils::normalizeFrequencies(uint freqs[], uint alphabet[], int length
205205
const int delta = int(sumScaledFreq - scale);
206206

207207
if (abs(delta) * 100 < int(freqs[idxMax]) * 5) {
208-
// Fast path: just adjust the max frequency (or fallback to slow path)
209-
if (int(freqs[idxMax]) > delta) {
210-
freqs[idxMax] -= delta;
211-
return alphabetSize;
212-
}
208+
// Fast path: just adjust the max frequency
209+
freqs[idxMax] -= delta;
210+
return alphabetSize;
213211
}
214212

215213
// Slow path: spread error across frequencies

0 commit comments

Comments
 (0)