Browse Source

Initialize regex only once

This code path is commonly used so let it initialize only once.
adaptive-webui-19844
Chocobo1 1 year ago
parent
commit
b3d2ba7d07
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/base/http/requestparser.cpp

2
src/base/http/requestparser.cpp

@ -189,7 +189,7 @@ bool RequestParser::parseRequestLine(const QString &line) @@ -189,7 +189,7 @@ bool RequestParser::parseRequestLine(const QString &line)
{
// [rfc7230] 3.1.1. Request Line
const QRegularExpression re(u"^([A-Z]+)\\s+(\\S+)\\s+HTTP\\/(\\d\\.\\d)$"_s);
static const QRegularExpression re(u"^([A-Z]+)\\s+(\\S+)\\s+HTTP\\/(\\d\\.\\d)$"_s);
const QRegularExpressionMatch match = re.match(line);
if (!match.hasMatch())

Loading…
Cancel
Save