Use static QRegularExpression

This commit is contained in:
Jonas Kvinge
2024-08-24 17:23:10 +02:00
parent a2cae06582
commit bc667a6474
31 changed files with 121 additions and 67 deletions

View File

@@ -436,7 +436,8 @@ void StreamingSearchView::SwapModels() {
QStringList StreamingSearchView::TokenizeQuery(const QString &query) {
QStringList tokens(query.split(QRegularExpression(QStringLiteral("\\s+"))));
static const QRegularExpression regex_whitespaces(QStringLiteral("\\s+"));
QStringList tokens = query.split(regex_whitespaces);
for (QStringList::iterator it = tokens.begin(); it != tokens.end(); ++it) {
(*it).remove(QLatin1Char('('));