Avoiding to increase an iterator when the result can be larger than their container end.
Bug: webrtc:15438 Change-Id: I0d75436bc845590c76466bde7007e921f842a9d4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/317320 Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40605}
This commit is contained in:
parent
45ccf63c0f
commit
1a4cf30047
@ -162,7 +162,8 @@ void MatchedFilterLagAggregator::PreEchoLagAggregator::Aggregate(
|
||||
float penalization_per_delay = 1.0f;
|
||||
float max_histogram_value = -1.0f;
|
||||
for (auto it = histogram_.begin();
|
||||
it + kMatchedFilterWindowSizeSubBlocks <= histogram_.end();
|
||||
std::distance(it, histogram_.end()) >=
|
||||
static_cast<int>(kMatchedFilterWindowSizeSubBlocks);
|
||||
it = it + kMatchedFilterWindowSizeSubBlocks) {
|
||||
auto it_max_element =
|
||||
std::max_element(it, it + kMatchedFilterWindowSizeSubBlocks);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user