make onLoss return if found

This commit is contained in:
Green Sky
2025-12-13 13:36:51 +01:00
parent 308790dc3a
commit 35a82cd67f
5 changed files with 16 additions and 8 deletions

View File

@@ -131,7 +131,7 @@ void LEDBAT::onAck(std::vector<SeqIDType> seqs) {
updateWindows();
}
void LEDBAT::onLoss(SeqIDType seq, bool discard) {
bool LEDBAT::onLoss(SeqIDType seq, bool discard) {
auto it = std::find_if(_in_flight.begin(), _in_flight.end(), [seq](const auto& v) -> bool {
assert(!std::isnan(std::get<1>(v)));
return std::get<0>(v) == seq;
@@ -139,7 +139,7 @@ void LEDBAT::onLoss(SeqIDType seq, bool discard) {
if (it == _in_flight.end()) {
// error
return; // not found, ignore ??
return false; // not found, ignore ??
}
if (PLOTTING) {
@@ -165,6 +165,8 @@ void LEDBAT::onLoss(SeqIDType seq, bool discard) {
#endif
updateWindows();
return true;
}
float LEDBAT::getCurrentDelay(void) const {