From: Suyeon Hwang Date: Mon, 26 Sep 2022 11:13:22 +0000 (+0900) Subject: Use reference type in vector iteration X-Git-Tag: accepted/tizen/unified/20221007.101823~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e8b5f5ee021ed7fcda2f1ec2b164bd2c6564b16c;p=platform%2Fcore%2Fuifw%2Fmmi-manager.git Use reference type in vector iteration Change-Id: Ic35c58fbaeffc37d3c9a6d19751b119270a15175 Signed-off-by: Suyeon Hwang --- diff --git a/src/mmimgr/iu/CommandFinder.cpp b/src/mmimgr/iu/CommandFinder.cpp index 986c05f..f63ef34 100644 --- a/src/mmimgr/iu/CommandFinder.cpp +++ b/src/mmimgr/iu/CommandFinder.cpp @@ -84,7 +84,7 @@ ClickableItem* CommandFinder::findCommandByIndex() 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(); @@ -98,7 +98,7 @@ ClickableItem* CommandFinder::findCommandByText() { _I("[CommandFinder] Find command by text"); - for (auto command : __commands) { + for (auto& command : __commands) { string label = StringUtil::makeLowerCase(command->label); bool isValid = true; @@ -125,7 +125,7 @@ ClickableItem* CommandFinder::findCommandByWord() 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; @@ -155,7 +155,7 @@ ClickableItem* CommandFinder::findCommandByChar() ClickableItem* result = nullptr; int resultScore = numeric_limits::max(); - for (auto command : __commands) { + for (auto& command : __commands) { string label = StringUtil::makeLowerCase(command->label); vector splitLabel = StringUtil::splitText(label, ' '); _D("[CommandFinder] Command(%s), candidate(%s)", __loweredText.c_str(), label.c_str());