Skip to content

Commit

Permalink
∞ Infinite speedup by not looping forever (#110)
Browse files Browse the repository at this point in the history
Resolves infinite loop introduced by #106
  • Loading branch information
danstiner authored Mar 16, 2021
1 parent 2231138 commit 92fce15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/JanusStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,15 @@ size_t JanusStream::StopRelay(const std::string& targetHostname)
for (auto it = relays.begin();
it != relays.end();)
{
if (it->TargetHostname == targetHostname) {
if (it->TargetHostname == targetHostname)
{
removedRelays.push_back(std::move(*it));
it = relays.erase(it);
}
else
{
++it;
}
}
}
for (Relay& relay : removedRelays)
Expand Down

0 comments on commit 92fce15

Please sign in to comment.