Skip to content

Commit

Permalink
[apps] Traverse srt_options by const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
quink-black authored and maxsharabayko committed Feb 8, 2021
1 parent 2e9c1c7 commit 662db72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/socketoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SocketOption::Mode SrtConfigurePre(SRTSOCKET socket, string host, map<string, st


bool all_clear = true;
for (auto o: srt_options)
for (const auto &o: srt_options)
{
if ( o.binding == SocketOption::PRE && options.count(o.name) )
{
Expand All @@ -124,7 +124,7 @@ void SrtConfigurePost(SRTSOCKET socket, map<string, string> options, vector<stri
vector<string> dummy;
vector<string>& fails = failures ? *failures : dummy;

for (auto o: srt_options)
for (const auto &o: srt_options)
{
if ( o.binding == SocketOption::POST && options.count(o.name) )
{
Expand Down
2 changes: 1 addition & 1 deletion apps/transmitmedia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ int SrtCommon::ConfigurePost(SRTSOCKET sock)

SrtConfigurePost(sock, m_options);

for (auto o: srt_options)
for (const auto &o: srt_options)
{
if ( o.binding == SocketOption::POST && m_options.count(o.name) )
{
Expand Down

0 comments on commit 662db72

Please sign in to comment.