Use accumulate to calculate recv_delta_size
It's a modern way to sum element of an a array. Bug: None Change-Id: Idb09442b4647b4be9771f64a7a561b305bd9aa6b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/233942 Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35139}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
606d3cb1cf
commit
41b4397e1a
@ -12,8 +12,10 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "modules/include/module_common_types_public.h"
|
||||
#include "modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "modules/rtp_rtcp/source/rtcp_packet/common_header.h"
|
||||
@ -447,10 +449,7 @@ bool TransportFeedback::Parse(const CommonHeader& packet) {
|
||||
num_seq_no_ = status_count;
|
||||
|
||||
uint16_t seq_no = base_seq_no_;
|
||||
size_t recv_delta_size = 0;
|
||||
for (size_t delta_size : delta_sizes) {
|
||||
recv_delta_size += delta_size;
|
||||
}
|
||||
size_t recv_delta_size = absl::c_accumulate(delta_sizes, 0);
|
||||
|
||||
// Determine if timestamps, that is, recv_delta are included in the packet.
|
||||
if (end_index >= index + recv_delta_size) {
|
||||
|
||||
Reference in New Issue
Block a user