return nullptr;
}
- for (auto command : __commands) {
+ for (auto& command : __commands) {
if (command->index == __index) {
_I("[CommandFinder] result command(%s)", command->label.c_str());
return command.get();
{
_I("[CommandFinder] Find command by text");
- for (auto command : __commands) {
+ for (auto& command : __commands) {
string label = StringUtil::makeLowerCase(command->label);
bool isValid = true;
ClickableItem* result = nullptr;
_I("[CommandFinder] Minimum matching word number (%d)", maxNumber);
- for (auto command : __commands) {
+ for (auto& command : __commands) {
string label = StringUtil::makeLowerCase(command->label);
int numOfWord = 0;
ClickableItem* result = nullptr;
int resultScore = numeric_limits<int>::max();
- for (auto command : __commands) {
+ for (auto& command : __commands) {
string label = StringUtil::makeLowerCase(command->label);
vector<string> splitLabel = StringUtil::splitText(label, ' ');
_D("[CommandFinder] Command(%s), candidate(%s)", __loweredText.c_str(), label.c_str());