summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/game_list.cpp8
-rw-r--r--src/yuzu/game_list.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 5a708dc73..fffa57ce1 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -141,10 +141,12 @@ GameList::SearchField::SearchField(GameList* parent) : QWidget{parent} {
141 * @param userinput String containing all words getting checked 141 * @param userinput String containing all words getting checked
142 * @return true if the haystack contains all words of userinput 142 * @return true if the haystack contains all words of userinput
143 */ 143 */
144bool GameList::containsAllWords(QString haystack, QString userinput) { 144bool GameList::containsAllWords(const QString& haystack, const QString& userinput) const {
145 QStringList userinput_split = userinput.split(" ", QString::SplitBehavior::SkipEmptyParts); 145 const QStringList userinput_split =
146 userinput.split(' ', QString::SplitBehavior::SkipEmptyParts);
147
146 return std::all_of(userinput_split.begin(), userinput_split.end(), 148 return std::all_of(userinput_split.begin(), userinput_split.end(),
147 [haystack](QString s) { return haystack.contains(s); }); 149 [&haystack](const QString& s) { return haystack.contains(s); });
148} 150}
149 151
150// Event in order to filter the gamelist after editing the searchfield 152// Event in order to filter the gamelist after editing the searchfield
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index 7aff597b7..bf8486b54 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -89,7 +89,7 @@ private:
89 89
90 void PopupContextMenu(const QPoint& menu_location); 90 void PopupContextMenu(const QPoint& menu_location);
91 void RefreshGameDirectory(); 91 void RefreshGameDirectory();
92 bool containsAllWords(QString haystack, QString userinput); 92 bool containsAllWords(const QString& haystack, const QString& userinput) const;
93 93
94 SearchField* search_field; 94 SearchField* search_field;
95 GMainWindow* main_window = nullptr; 95 GMainWindow* main_window = nullptr;