mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 10:44:26 +02:00
Fix LossList length not cumputed
This commit is contained in:
parent
cc4347ef6e
commit
c3995a6e23
1 changed files with 6 additions and 1 deletions
|
@ -51,6 +51,7 @@ void LossList::remove(SeqNum seq) {
|
||||||
it->second = seq - 1;
|
it->second = seq - 1;
|
||||||
_lossList.insert(it, make_pair(seq + 1, temp));
|
_lossList.insert(it, make_pair(seq + 1, temp));
|
||||||
}
|
}
|
||||||
|
_length -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,11 +69,13 @@ void LossList::remove(SeqNum start, SeqNum end) {
|
||||||
// or remove it altogether since it is fully contained it the range
|
// or remove it altogether since it is fully contained it the range
|
||||||
while (it != _lossList.end() && end >= it->second) {
|
while (it != _lossList.end() && end >= it->second) {
|
||||||
if (start <= it->first) {
|
if (start <= it->first) {
|
||||||
// Segment is contained, erase it.
|
// Segment is contained, update new length and erase it.
|
||||||
|
_length -= seqlen(it->first, it->second);
|
||||||
it = _lossList.erase(it);
|
it = _lossList.erase(it);
|
||||||
} else {
|
} else {
|
||||||
// Beginning of segment not contained, modify end of segment.
|
// Beginning of segment not contained, modify end of segment.
|
||||||
// Will only occur sometimes one the first loop
|
// Will only occur sometimes one the first loop
|
||||||
|
_length -= seqlen(start, it->second);
|
||||||
it->second = start - 1;
|
it->second = start - 1;
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
@ -82,9 +85,11 @@ void LossList::remove(SeqNum start, SeqNum end) {
|
||||||
if (it != _lossList.end() && it->first <= end) {
|
if (it != _lossList.end() && it->first <= end) {
|
||||||
if (start <= it->first) {
|
if (start <= it->first) {
|
||||||
// Truncate beginning of segment
|
// Truncate beginning of segment
|
||||||
|
_length -= seqlen(it->first, end);
|
||||||
it->first = end + 1;
|
it->first = end + 1;
|
||||||
} else {
|
} else {
|
||||||
// Cut it in half if the range we are removing is contained within one segment
|
// Cut it in half if the range we are removing is contained within one segment
|
||||||
|
_length -= seqlen(start, end);
|
||||||
auto temp = it->second;
|
auto temp = it->second;
|
||||||
it->second = start - 1;
|
it->second = start - 1;
|
||||||
_lossList.insert(it, make_pair(end + 1, temp));
|
_lossList.insert(it, make_pair(end + 1, temp));
|
||||||
|
|
Loading…
Reference in a new issue