From 768ced88ddf97361f428079267607fa12ed354bf Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 2 Oct 2023 17:53:54 +0200 Subject: [PATCH] Fix: String Search: avoid casting match scores to int --- source/blender/blenlib/intern/string_search.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenlib/intern/string_search.cc b/source/blender/blenlib/intern/string_search.cc index 5adeebff0f0..d2d0e626dec 100644 --- a/source/blender/blenlib/intern/string_search.cc +++ b/source/blender/blenlib/intern/string_search.cc @@ -466,8 +466,8 @@ Vector StringSearchBase::query_impl(const StringRef query) const } } - Vector found_scores; - for (const int score : result_indices_by_score.keys()) { + Vector found_scores; + for (const float score : result_indices_by_score.keys()) { found_scores.append(score); } std::sort(found_scores.begin(), found_scores.end(), std::greater<>()); @@ -475,7 +475,7 @@ Vector StringSearchBase::query_impl(const StringRef query) const /* Add results to output vector in correct order. First come the results with the best match * score. Results with the same score are in the order they have been added to the search. */ Vector sorted_result_indices; - for (const int score : found_scores) { + for (const float score : found_scores) { MutableSpan indices = result_indices_by_score.lookup(score); if (score == found_scores[0]) { if (!query.is_empty()) {