Skip to content

Commit

Permalink
refactor: try rewrite max manually
Browse files Browse the repository at this point in the history
  • Loading branch information
ftschirpke committed Aug 6, 2024
1 parent 64f6d51 commit 980e954
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/searching/fuzzy_search/fuzzy_string_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,12 @@ int64_t fuzzy_match_string(const std::string& search_query, const std::string& s
in_gap = false;
} else {
int16_t gap_penalty = in_gap ? SCORE_GAP_EXTENSION : SCORE_GAP_START;
initial_scores[i] = std::max(previous_inital_bonus + gap_penalty, 0);
int16_t score = previous_inital_bonus + gap_penalty;
if (score < 0) {
initial_scores[i] = 0;
} else {
initial_scores[0] = score;
}
initial_occupation[i] = 0;
in_gap = true;
}
Expand Down

0 comments on commit 980e954

Please sign in to comment.