qnetworkrequest: port parseHeaderName to QBAV
Change-Id: I39af8649468636d09db46aac770f5df7a3582b50 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
49e52e8dd6
commit
8db5896bbe
@ -1127,13 +1127,13 @@ static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVaria
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
static int parseHeaderName(const QByteArray &headerName)
|
||||
static int parseHeaderName(QByteArrayView headerName)
|
||||
{
|
||||
if (headerName.isEmpty())
|
||||
return -1;
|
||||
|
||||
auto is = [&](const char *what) {
|
||||
return qstrnicmp(headerName.data(), headerName.size(), what) == 0;
|
||||
auto is = [headerName](QByteArrayView what) {
|
||||
return headerName.compare(what, Qt::CaseInsensitive) == 0;
|
||||
};
|
||||
|
||||
switch (QtMiscUtils::toAsciiLower(headerName.front())) {
|
||||
|
Loading…
Reference in New Issue
Block a user