Switch to string view where applicable

PR #22438.
This commit is contained in:
Chocobo1
2025-03-17 19:28:38 +08:00
committed by GitHub
parent 5a4b3b25d3
commit 8d0870c953
5 changed files with 24 additions and 27 deletions

View File

@@ -204,7 +204,7 @@ bool RequestParser::parseRequestLine(const QString &line)
m_request.method = match.captured(1);
// Request Target
const QByteArray url {match.captured(2).toLatin1()};
const QByteArray url {match.capturedView(2).toLatin1()};
const int sepPos = url.indexOf('?');
const QByteArrayView pathComponent = ((sepPos == -1) ? url : QByteArrayView(url).first(sepPos));