useractions: Use static regex

The method is called quite often during KWins lifetime.
Because the pattern is constant, we can reuse the value instead of creating a new regex every time
master
Alexander Lohnau 11 months ago
parent 08c3399568
commit 6b83654560

@ -1791,7 +1791,7 @@ void Window::setShortcut(const QString &_cut)
} }
return; return;
} }
const QRegularExpression reg(QStringLiteral("(.*\\+)\\((.*)\\)")); static const QRegularExpression reg(QStringLiteral("(.*\\+)\\((.*)\\)"));
QList<QKeySequence> keys; QList<QKeySequence> keys;
const QStringList groups = cut.split(QStringLiteral(" - ")); const QStringList groups = cut.split(QStringLiteral(" - "));
for (auto it = groups.begin(); it != groups.end(); ++it) { for (auto it = groups.begin(); it != groups.end(); ++it) {

Loading…
Cancel
Save