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;
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;
}