Bug 1848073 - Fix coverity UNUSED_VALUE error in OggDemuxer::SeekBisection r=padenot

`mustBackoff` is set to `false` immediately before entering a `while(true)` loop. The loop's final line is `break`, meaning that reaching a `continue` statement is necessary to loop. However, each `continue` statement is preceded by assigning `mustBackoff` to `true`. This means that `mustBackoff` will always evaluate to `false` for this loop's first iteration, and `true` for any subsequent iterations. As `mustBackoff` is only evaluated once and the evaluation happens at the beginning of the loop, assigning `mustBackoff` to `false` afterwards will have no impact on execution and the line can safely be removed.

Differential Revision: https://phabricator.services.mozilla.com/D185966
This commit is contained in:
az 2024-05-01 16:23:39 +00:00
parent 364416fb13
commit 476ed793c6

View file

@ -2050,11 +2050,7 @@ nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType,
interval = 0;
break;
}
backsteps = std::min(backsteps + 1, maxBackStep);
// We reset mustBackoff. If we still need to backoff further, it will
// be set to true again.
mustBackoff = false;
} else {
backsteps = 0;
}