From ae6e0b20584d6b67998dbedcc335bb8142ce37e3 Mon Sep 17 00:00:00 2001 From: Yves Gerey Date: Tue, 22 Jan 2019 21:48:57 +0100 Subject: [PATCH] [CodeHealth] Fix use after std::move instances. The parameter was expanded twice in the macro, leading to double use and move. This is both an example of: * Issue spotted by clandtidy's bug-prone patterns. * Premature optimization. Bug: webrtc:9855 Change-Id: I1a0cb2c99f95c6aec79ba1eb198aa39743ccbcd9 Reviewed-on: https://webrtc-review.googlesource.com/c/119042 Reviewed-by: Steve Anton Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#26367} --- pc/peer_connection.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 41fadd8d1f..0cbd3153f7 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -5237,7 +5237,7 @@ RTCError PeerConnection::PushdownMediaDescription( ? channel->SetLocalContent(content_desc, type, &error) : channel->SetRemoteContent(content_desc, type, &error); if (!success) { - LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, std::move(error)); + LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, error); } } @@ -5255,8 +5255,7 @@ RTCError PeerConnection::PushdownMediaDescription( ? rtp_data_channel_->SetLocalContent(data_desc, type, &error) : rtp_data_channel_->SetRemoteContent(data_desc, type, &error); if (!success) { - LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, - std::move(error)); + LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER, error); } } }