From 63654ef024d62515a1bc22791b638edf2c032246 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Mon, 17 Jan 2022 14:10:48 +0100 Subject: [PATCH] Remove manual implementaion of the c++17 insert_or_assign In favor of the standard one https://en.cppreference.com/w/cpp/container/map/insert_or_assign Bug: None Change-Id: I35e7a2fa11603caefca66e7caa3ecd1396601c98 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247181 Auto-Submit: Danil Chapovalov Reviewed-by: Philip Eliasson Commit-Queue: Philip Eliasson Cr-Commit-Position: refs/heads/main@{#35711} --- .../remote_bitrate_estimator_abs_send_time.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc index ae960ab960..0bc4f6dd12 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc @@ -278,13 +278,7 @@ void RemoteBitrateEstimatorAbsSendTime::IncomingPacketInfo( TimeoutStreams(now); RTC_DCHECK(inter_arrival_); RTC_DCHECK(estimator_); - // TODO(danilchap): Replace 5 lines below with insert_or_assign when that - // c++17 function is available. - auto inserted = ssrcs_.insert(std::make_pair(ssrc, now)); - if (!inserted.second) { - // Already inserted, update. - inserted.first->second = now; - } + ssrcs_.insert_or_assign(ssrc, now); // For now only try to detect probes while we don't have a valid estimate. // We currently assume that only packets larger than 200 bytes are paced by