diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-01-18 01:32:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-18 14:45:46 +0100 |
commit | 3359932202f79b0fa80ae8d3a6ec73f35b34c738 (patch) | |
tree | b452b15c63e073db4b3e19b6ee19db159af89d6d /src/websockets/qwebsockethandshakerequest.cpp | |
parent | abf5f99d1808bbf18b8ebbe2b9468d409fe77158 (diff) | |
download | qtwebsockets-3359932202f79b0fa80ae8d3a6ec73f35b34c738.tar.gz |
Use QString() instead of QStringLiteral("")
And do the same for QByteArray.
Instantiating the default constructor uses QArrayData::sharedNull() for
the d-pointer which is the cheapest constructor in memory and
instructions.
Change-Id: I1ceaafbc0c0cb1ccc5690edba89ea1100f30b3cd
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'src/websockets/qwebsockethandshakerequest.cpp')
-rw-r--r-- | src/websockets/qwebsockethandshakerequest.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/websockets/qwebsockethandshakerequest.cpp b/src/websockets/qwebsockethandshakerequest.cpp index fbc25a7..c47dfd0 100644 --- a/src/websockets/qwebsockethandshakerequest.cpp +++ b/src/websockets/qwebsockethandshakerequest.cpp @@ -229,7 +229,7 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream) headerLine = textStream.readLine(); } - const QString host = m_headers.value(QStringLiteral("Host"), QStringLiteral("")); + const QString host = m_headers.value(QStringLiteral("Host"), QString()); m_requestUrl = QUrl::fromEncoded(resourceName.toLatin1()); if (m_requestUrl.isRelative()) m_requestUrl.setHost(host); @@ -255,11 +255,11 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream) } //sort in descending order std::sort(m_versions.begin(), m_versions.end(), std::greater<QWebSocketProtocol::Version>()); - m_key = m_headers.value(QStringLiteral("Sec-WebSocket-Key"), QStringLiteral("")); + m_key = m_headers.value(QStringLiteral("Sec-WebSocket-Key"), QString()); //must contain "Upgrade", case-insensitive - const QString upgrade = m_headers.value(QStringLiteral("Upgrade"), QStringLiteral("")); + const QString upgrade = m_headers.value(QStringLiteral("Upgrade"), QString()); //must be equal to "websocket", case-insensitive - const QString connection = m_headers.value(QStringLiteral("Connection"), QStringLiteral("")); + const QString connection = m_headers.value(QStringLiteral("Connection"), QString()); const QStringList connectionLine = connection.split(QStringLiteral(","), QString::SkipEmptyParts); QStringList connectionValues; @@ -267,7 +267,7 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream) connectionValues << (*c).trimmed(); //optional headers - m_origin = m_headers.value(QStringLiteral("Sec-WebSocket-Origin"), QStringLiteral("")); + m_origin = m_headers.value(QStringLiteral("Sec-WebSocket-Origin"), QString()); const QStringList protocolLines = m_headers.values(QStringLiteral("Sec-WebSocket-Protocol")); for (QStringList::const_iterator pl = protocolLines.begin(); pl != protocolLines.end(); ++pl) { QStringList protocols = (*pl).split(QStringLiteral(","), QString::SkipEmptyParts); |