Do not sort results of WordDB, simplify code

This commit is contained in:
Maxime Coste 2014-12-11 13:14:57 +00:00
parent f32ab5793e
commit 35e7a67c6a

View File

@ -137,12 +137,10 @@ std::vector<InternedString> find_matching(const WordDB::WordList& words, StringV
std::vector<InternedString> res; std::vector<InternedString> res;
for (auto&& word : words) for (auto&& word : words)
{ {
if ((letters & word.second.letters) != letters) if ((letters & word.second.letters) == letters and
continue; func(word.first, str))
if (func(word.first, str))
res.push_back(word.first); res.push_back(word.first);
} }
std::sort(res.begin(), res.end());
return res; return res;
} }