diff --git a/ixwebsocket/IXWebSocket.cpp b/ixwebsocket/IXWebSocket.cpp index b74426ef..8ba50eea 100644 --- a/ixwebsocket/IXWebSocket.cpp +++ b/ixwebsocket/IXWebSocket.cpp @@ -209,7 +209,7 @@ namespace ix WebSocketHttpHeaders headers(_extraHeaders); std::string subProtocolsHeader; - auto subProtocols = getSubProtocols(); + const auto &subProtocols = getSubProtocols(); if (!subProtocols.empty()) { // @@ -219,7 +219,7 @@ namespace ix // 'json,msgpack' // int i = 0; - for (auto subProtocol : subProtocols) + for (const auto & subProtocol : subProtocols) { if (i++ != 0) {