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

@@ -107,7 +107,7 @@ QString PrettyFutureDate(const QDate date) {
QDateTime ParseRFC822DateTime(const QString &text) {
QRegularExpression regexp(QStringLiteral("(\\d{1,2}) (\\w{3,12}) (\\d+) (\\d{1,2}):(\\d{1,2}):(\\d{1,2})"));
static const QRegularExpression regexp(QStringLiteral("(\\d{1,2}) (\\w{3,12}) (\\d+) (\\d{1,2}):(\\d{1,2}):(\\d{1,2})"));
QRegularExpressionMatch re_match = regexp.match(text);
if (!re_match.hasMatch()) {
return QDateTime();