mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Initialize regex only once
This code path is commonly used so let it initialize only once.
This commit is contained in:
parent
03d3552ee0
commit
b3d2ba7d07
@ -189,7 +189,7 @@ bool RequestParser::parseRequestLine(const QString &line)
|
|||||||
{
|
{
|
||||||
// [rfc7230] 3.1.1. Request 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);
|
const QRegularExpressionMatch match = re.match(line);
|
||||||
|
|
||||||
if (!match.hasMatch())
|
if (!match.hasMatch())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user