From 9f3a44f5152816e3a0cb6902e0dadf365ff4e7d0 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 30 Jan 2019 13:47:42 +0100 Subject: [PATCH] Introcuce RTCError(const T&) constructor. This CL is spawned from [1] and it introduces RTCError(const T&) in order to remove an unneeded std::move. [1] - https://webrtc-review.googlesource.com/c/src/+/120350 Bug: webrtc:10252 Change-Id: Ibd5aa1c901fd920549e9437908178c786019a328 Reviewed-on: https://webrtc-review.googlesource.com/c/120560 Commit-Queue: Mirko Bonadei Reviewed-by: Karl Wiberg Cr-Commit-Position: refs/heads/master@{#26468} --- api/rtc_error.h | 1 + pc/peer_connection.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/rtc_error.h b/api/rtc_error.h index 673a79a2a1..904a619a5d 100644 --- a/api/rtc_error.h +++ b/api/rtc_error.h @@ -220,6 +220,7 @@ class RTCErrorOr { // NOTE: Not explicit - we want to use RTCErrorOr as a return type // so it is convenient and sensible to be able to do 'return T()' // when the return type is RTCErrorOr. + RTCErrorOr(const T& value) : value_(value) {} // NOLINT RTCErrorOr(T&& value) : value_(std::move(value)) {} // NOLINT // Delete the copy constructor and assignment operator; there aren't any use diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 10901496f0..e0479d134a 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -6016,7 +6016,7 @@ RTCErrorOr PeerConnection::GetEarlyBundleGroup( "has no BUNDLE group"); } } - return std::move(bundle_group); + return bundle_group; } RTCError PeerConnection::CreateChannels(const SessionDescription& desc) {