From dc1f8199529829b68b908eb188541c06c712a2e3 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Wed, 9 Sep 2020 15:13:19 -0600 Subject: [PATCH] fix infinite loop --- extensions/extrawindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/extrawindow.cpp b/extensions/extrawindow.cpp index 002a2d8..b2a581d 100644 --- a/extensions/extrawindow.cpp +++ b/extensions/extrawindow.cpp @@ -444,8 +444,8 @@ private: { QStringList currentInflectionsUsed = inflectionsUsed; currentInflectionsUsed.push_front(inflection.name); - QString root = inflection.root; - for (int i = 0; i < root.size(); ++i) if (root[i].isDigit()) root.replace(i, 1, match.captured(root[i].digitValue())); + QString root; + for (const auto& ch : inflection.root) root += ch.isDigit() ? match.captured(ch.digitValue()) : ch; for (const auto& definition : LookupDefinitions(root, foundDefinitions, currentInflectionsUsed)) results.push_back(definition); } return results;