summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-12-11 13:14:57 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-12-11 13:14:57 +0000
commit35e7a67c6a85c9729b5c978edc59f6f200f4729f (patch)
tree159502995d6458d6e69de5c4abdae2f2ea51b5e1 /src
parentf32ab5793e7f0a8faa59b8eb82dc2ad519305622 (diff)
Do not sort results of WordDB, simplify code
Diffstat (limited to 'src')
-rw-r--r--src/word_db.cc6
1 files 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<InternedString> find_matching(const WordDB::WordList& words, StringV
std::vector<InternedString> 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;
}