Skip to content

Commit 73e0b36

Browse files
committed
fix: filter_internal: take out the invariant scoreProvider from loop
1 parent 0ce4f24 commit 73e0b36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/filter.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ void filter_internal(const std::vector<CandidateString> &candidates,
2424
const Options &options,
2525
size_t max_results,
2626
CandidateScorePriorityQueue &results) {
27+
const auto scoreProvider = options.usePathScoring ? path_scorer_score : scorer_score;
2728
for (size_t i = 0, len = candidates.size(); i < len; i++) {
2829
const auto &candidate = candidates[i];
2930
if (candidate.empty()) {
3031
continue;
3132
}
32-
const auto scoreProvider = options.usePathScoring ? path_scorer_score : scorer_score;
3333
auto score = scoreProvider(candidate, query, options);
3434
if (score > 0) {
3535
results.emplace(score, start_index + i);

0 commit comments

Comments
 (0)