Skip to content

Commit

Permalink
[core] Combined the loops of m_FreshLoss and m_pRcvLossList
Browse files Browse the repository at this point in the history
  • Loading branch information
gou4shi1 authored and maxsharabayko committed Sep 29, 2022
1 parent daf91f3 commit a1c0ab3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions srtcore/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10348,24 +10348,17 @@ int srt::CUDT::processData(CUnit* in_unit)
ScopedLock lock(m_RcvLossLock);

HLOGC(qrlog.Debug,
log << CONID() << "processData: LOSS DETECTED, %: " << Printable(srt_loss_seqs) << " - RECORDING.");
log << CONID() << "processData: RECORDING LOSS: " << Printable(srt_loss_seqs)
<< " tolerance=" << initial_loss_ttl);

for (loss_seqs_t::iterator i = srt_loss_seqs.begin(); i != srt_loss_seqs.end(); ++i)
{
// If loss found, insert them to the receiver loss list.
m_pRcvLossList->insert(i->first, i->second);
}

if (initial_loss_ttl)
{
// pack loss list for (possibly belated) NAK
// The LOSSREPORT will be sent in a while.
for (loss_seqs_t::iterator i = srt_loss_seqs.begin(); i != srt_loss_seqs.end(); ++i)
if (initial_loss_ttl)
{
// The LOSSREPORT will be sent after initial_loss_ttl.
m_FreshLoss.push_back(CRcvFreshLoss(i->first, i->second, initial_loss_ttl));
}
HLOGC(qrlog.Debug,
log << CONID() << "FreshLoss: added sequences: " << Printable(srt_loss_seqs)
<< " tolerance: " << initial_loss_ttl);
}
}

Expand Down

0 comments on commit a1c0ab3

Please sign in to comment.