From 35e7a67c6a85c9729b5c978edc59f6f200f4729f Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 Dec 2014 13:14:57 +0000 Subject: [PATCH] Do not sort results of WordDB, simplify code --- src/word_db.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/word_db.cc b/src/word_db.cc index dcf1a633..193380ac 100644 --- a/src/word_db.cc +++ b/src/word_db.cc @@ -137,12 +137,10 @@ std::vector find_matching(const WordDB::WordList& words, StringV std::vector res; for (auto&& word : words) { - if ((letters & word.second.letters) != letters) - continue; - if (func(word.first, str)) + if ((letters & word.second.letters) == letters and + func(word.first, str)) res.push_back(word.first); } - std::sort(res.begin(), res.end()); return res; }