Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-02-10 18:53:40 +0300
committerJacques Lucke <jacques@blender.org>2021-02-10 18:53:40 +0300
commitb5536c97b756224324995fc2a766a38d53a31d11 (patch)
treeec31ca208b83a254540503b792cf1a82c17487b1 /source/blender/blenlib/intern/string_search.cc
parentbdb83cc32cbd0997752420ef95c791f66dca54c8 (diff)
parent40a18612651873373ea267195ecc654e9fc344bb (diff)
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/blenlib/intern/string_search.cc')
-rw-r--r--source/blender/blenlib/intern/string_search.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/string_search.cc b/source/blender/blenlib/intern/string_search.cc
index a5983967542..a09aa7a4bc2 100644
--- a/source/blender/blenlib/intern/string_search.cc
+++ b/source/blender/blenlib/intern/string_search.cc
@@ -250,7 +250,7 @@ static int get_shortest_word_index_that_startswith(StringRef query,
Span<bool> word_is_usable)
{
int best_word_size = INT32_MAX;
- int bset_word_index = -1;
+ int best_word_index = -1;
for (const int i : words.index_range()) {
if (!word_is_usable[i]) {
continue;
@@ -258,11 +258,12 @@ static int get_shortest_word_index_that_startswith(StringRef query,
StringRef word = words[i];
if (word.startswith(query)) {
if (word.size() < best_word_size) {
- bset_word_index = i;
+ best_word_index = i;
+ best_word_size = word.size();
}
}
}
- return bset_word_index;
+ return best_word_index;
}
static int get_word_index_that_fuzzy_matches(StringRef query,