1 files changed, 3 insertions, 1 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 6980c364..2f3b6eae 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -776,7 +776,9 @@ InputBar::getCommandAndArgs(const QString ¤tText) const
if (!currentText.startsWith('/'))
return {{}, currentText};
- int command_end = currentText.indexOf(QRegularExpression(QStringLiteral("\\s")));
+ static QRegularExpression spaceRegex(QStringLiteral("\\s"));
+
+ int command_end = currentText.indexOf(spaceRegex);
if (command_end == -1)
command_end = currentText.size();
auto name = currentText.mid(1, command_end - 1);
|