Fix correction infinite loop

This commit is contained in:
Gres 2020-03-08 13:47:15 +03:00
parent 6d820ad229
commit a197edd62b

View File

@ -39,6 +39,8 @@ QString Corrector::substituteUser(const QString &source,
for (auto it = range.first; it != range.second; ++it) { for (auto it = range.first; it != range.second; ++it) {
const auto &sub = it->second; const auto &sub = it->second;
if (!result.contains(sub.source))
continue;
const auto len = sub.source.length(); const auto len = sub.source.length();
if (len > bestMatchLen) { if (len > bestMatchLen) {
bestMatchLen = len; bestMatchLen = len;