mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue