[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 <steveanton@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26367}
This commit is contained in:
Yves Gerey 2019-01-22 21:48:57 +01:00 committed by Commit Bot
parent e54287a4ae
commit ae6e0b2058

View File

@ -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);
}
}
}