summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2017-10-06 10:59:27 (GMT)
committerAndré Klitzing <aklitzing@gmail.com>2017-10-10 16:15:59 (GMT)
commitb05ec56db6f17f04387af72b8e1b9a64b1092daa (patch)
treeab1f0f02b43081f9440f9749d93298aa7bcd50bf /src
parent15ca7cc061285dcaab1c650937c8f3a5bbbdfa28 (diff)
downloadqtwebsockets-b05ec56db6f17f04387af72b8e1b9a64b1092daa.tar.gz
Replace iterator based loop by range-for-loop
Found by clazy and fixes "clazy-strict-iterators" warning. Change-Id: I8f50c92ac054d627499440d593faa43ed5b4ad4b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/websockets/qwebsockethandshakerequest.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/websockets/qwebsockethandshakerequest.cpp b/src/websockets/qwebsockethandshakerequest.cpp
index ddeee2d..e6a626c 100644
--- a/src/websockets/qwebsockethandshakerequest.cpp
+++ b/src/websockets/qwebsockethandshakerequest.cpp
@@ -318,17 +318,17 @@ void QWebSocketHandshakeRequest::readHandshake(QTextStream &textStream, int maxH
//optional headers
m_origin = m_headers.value(QStringLiteral("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);
- for (QStringList::const_iterator p = protocols.begin(); p != protocols.end(); ++p)
- m_protocols << (*p).trimmed();
+ for (const QString& pl : protocolLines) {
+ const QStringList protocols = pl.split(QStringLiteral(","), QString::SkipEmptyParts);
+ for (const QString& p : protocols)
+ m_protocols << p.trimmed();
}
+
const QStringList extensionLines = m_headers.values(QStringLiteral("sec-websocket-extensions"));
- for (QStringList::const_iterator el = extensionLines.begin();
- el != extensionLines.end(); ++el) {
- QStringList extensions = (*el).split(QStringLiteral(","), QString::SkipEmptyParts);
- for (QStringList::const_iterator e = extensions.begin(); e != extensions.end(); ++e)
- m_extensions << (*e).trimmed();
+ for (const QString& el : extensionLines) {
+ const QStringList extensions = el.split(QStringLiteral(","), QString::SkipEmptyParts);
+ for (const QString& e : extensions)
+ m_extensions << e.trimmed();
}
//TODO: authentication field