[Bf-blender-cvs] [40a18612651] blender-v2.92-release: Fix T85514: exact match is not showing up in search menu

Jacques Lucke noreply at git.blender.org
Wed Feb 10 16:53:06 CET 2021


Commit: 40a18612651873373ea267195ecc654e9fc344bb
Author: Jacques Lucke
Date:   Wed Feb 10 16:51:39 2021 +0100
Branches: blender-v2.92-release
https://developer.blender.org/rB40a18612651873373ea267195ecc654e9fc344bb

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.

===================================================================

M	source/blender/blenlib/intern/string_search.cc

===================================================================

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();
       }
     }
   }



More information about the Bf-blender-cvs mailing list