Skip to content

Commit

Permalink
svsps: fix unsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Dec 8, 2023
1 parent d31e0df commit 7b5577b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ndn-svs/svspubsub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ SVSPubSub::subscribeToProducer(const Name& nodePrefix, const SubscriptionCallbac
void
SVSPubSub::unsubscribe(uint32_t handle)
{
auto unsub = [handle](std::vector<Subscription> subs)
auto unsub = [handle](std::vector<Subscription>& subs)
{
for (size_t i = 0; i < subs.size(); i++)
for (auto it = subs.begin(); it != subs.end(); ++it)
{
if (subs[i].id == handle)
if (it->id == handle)
{
subs.erase(subs.begin() + i);
subs.erase(it);
return;
}
}
Expand Down

0 comments on commit 7b5577b

Please sign in to comment.