We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58423d2 commit 06acbafCopy full SHA for 06acbaf
src/classify/intmatcher.cpp
@@ -1229,7 +1229,7 @@ int IntegerMatcher::FindBestMatch(
1229
float IntegerMatcher::ApplyCNCorrection(float rating, int blob_length,
1230
int normalization_factor,
1231
int matcher_multiplier) {
1232
- return (rating * blob_length +
1233
- matcher_multiplier * normalization_factor / 256.0) /
1234
- (blob_length + matcher_multiplier);
+ int divisor = blob_length + matcher_multiplier;
+ return divisor == 0 ? 1.0f : (rating * blob_length +
+ matcher_multiplier * normalization_factor / 256.0f) / divisor;
1235
}
0 commit comments