avoid some object copies

This commit is contained in:
Benjamin Sergeant 2024-03-27 22:03:26 -07:00
parent 014d43eb13
commit 92beef8348

View File

@ -209,7 +209,7 @@ namespace ix
WebSocketHttpHeaders headers(_extraHeaders); WebSocketHttpHeaders headers(_extraHeaders);
std::string subProtocolsHeader; std::string subProtocolsHeader;
auto subProtocols = getSubProtocols(); const auto &subProtocols = getSubProtocols();
if (!subProtocols.empty()) if (!subProtocols.empty())
{ {
// //
@ -219,7 +219,7 @@ namespace ix
// 'json,msgpack' // 'json,msgpack'
// //
int i = 0; int i = 0;
for (auto subProtocol : subProtocols) for (const auto & subProtocol : subProtocols)
{ {
if (i++ != 0) if (i++ != 0)
{ {