stats: replace new with std::make_unique
apart from the certificate stats which need to update the
reference to the previous certificate stats in the chain.
BUG=None
Change-Id: I27f58084b849fd9afe236e5b57139bedb8eb1811
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274175
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38026}
diff --git a/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc
index 321d8db..b1b081f 100644
--- a/stats/rtcstats_objects.cc
+++ b/stats/rtcstats_objects.cc
@@ -335,7 +335,7 @@
: RTCIceCandidateStats(std::move(id), timestamp_us, false) {}
std::unique_ptr<RTCStats> RTCLocalIceCandidateStats::copy() const {
- return std::unique_ptr<RTCStats>(new RTCLocalIceCandidateStats(*this));
+ return std::make_unique<RTCLocalIceCandidateStats>(*this);
}
const char* RTCLocalIceCandidateStats::type() const {
@@ -353,7 +353,7 @@
: RTCIceCandidateStats(std::move(id), timestamp_us, true) {}
std::unique_ptr<RTCStats> RTCRemoteIceCandidateStats::copy() const {
- return std::unique_ptr<RTCStats>(new RTCRemoteIceCandidateStats(*this));
+ return std::make_unique<RTCRemoteIceCandidateStats>(*this);
}
const char* RTCRemoteIceCandidateStats::type() const {