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:51:39 +0300
committerJacques Lucke <jacques@blender.org>2021-02-10 18:52:09 +0300
commit40a18612651873373ea267195ecc654e9fc344bb (patch)
treee6c9e66f5c090cbbfb293223ea74b760984c2473
parent806b22d13093f7f90bc53849290db6b10a1cbe7e (diff)
Fix T85514: exact match is not showing up in search menu
The `get_shortest_word_index_that_startswith` function was not doing what it was supposed to do. This resulted in wrong matches.
-rw-r--r--source/blender/blenlib/intern/string_search.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/string_search.cc b/source/blender/blenlib/intern/string_search.cc
index 22ba1b07e9c..a45909f92d8 100644
--- a/source/blender/blenlib/intern/string_search.cc
+++ b/source/blender/blenlib/intern/string_search.cc
@@ -259,6 +259,7 @@ static int get_shortest_word_index_that_startswith(StringRef query,
if (word.startswith(query)) {
if (word.size() < best_word_size) {
best_word_index = i;
+ best_word_size = word.size();
}
}
}