From 13dde1c6ccc3de273e564fed2b39cc38f2e67bf6 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Fri, 7 Oct 2016 16:42:33 -0700 Subject: [PATCH] Remove pessimizing std::move() calls. Found with -Wpessimizing-move. Signed-off-by: Piotr Sikora --- source/common/http/access_log/access_log_formatter.cc | 2 +- source/common/http/access_log/access_log_impl.cc | 2 +- source/common/http/codec_client.cc | 2 +- source/common/http/conn_manager_impl.cc | 5 ++--- source/common/http/http2/codec_impl.cc | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/common/http/access_log/access_log_formatter.cc b/source/common/http/access_log/access_log_formatter.cc index 9a99313a1dc3..0c57459f3cc4 100644 --- a/source/common/http/access_log/access_log_formatter.cc +++ b/source/common/http/access_log/access_log_formatter.cc @@ -55,7 +55,7 @@ FormatterPtr AccessLogFormatUtils::defaultAccessLogFormatter() { } FormatterImpl::FormatterImpl(const std::string& format) { - formatters_ = std::move(AccessLogFormatParser::parse(format)); + formatters_ = AccessLogFormatParser::parse(format); } std::string FormatterImpl::format(const Http::HeaderMap& request_headers, diff --git a/source/common/http/access_log/access_log_impl.cc b/source/common/http/access_log/access_log_impl.cc index 1e2a6cc440ec..7787f26b9283 100644 --- a/source/common/http/access_log/access_log_impl.cc +++ b/source/common/http/access_log/access_log_impl.cc @@ -182,7 +182,7 @@ InstancePtr InstanceImpl::fromJson(Json::Object& json, Api::Api& api, Event::Dis if (json.hasObject("format")) { formatter.reset(new FormatterImpl(json.getString("format"))); } else { - formatter = std::move(AccessLogFormatUtils::defaultAccessLogFormatter()); + formatter = AccessLogFormatUtils::defaultAccessLogFormatter(); } return InstancePtr{new InstanceImpl(access_log_path, api, std::move(filter), std::move(formatter), diff --git a/source/common/http/codec_client.cc b/source/common/http/codec_client.cc index b0dd2b648853..d6d1ac2bfc6a 100644 --- a/source/common/http/codec_client.cc +++ b/source/common/http/codec_client.cc @@ -28,7 +28,7 @@ CodecClient::~CodecClient() {} void CodecClient::close() { connection_->close(Network::ConnectionCloseType::NoFlush); } void CodecClient::deleteRequest(ActiveRequest& request) { - connection_->dispatcher().deferredDelete(std::move(request.removeFromList(active_requests_))); + connection_->dispatcher().deferredDelete(request.removeFromList(active_requests_)); if (codec_client_callbacks_) { codec_client_callbacks_->onStreamDestroy(); } diff --git a/source/common/http/conn_manager_impl.cc b/source/common/http/conn_manager_impl.cc index 47c623e1a332..f41ab0522a5c 100644 --- a/source/common/http/conn_manager_impl.cc +++ b/source/common/http/conn_manager_impl.cc @@ -100,8 +100,7 @@ void ConnectionManagerImpl::destroyStream(ActiveStream& stream) { } if (!reset_stream) { - read_callbacks_->connection().dispatcher().deferredDelete( - std::move(stream.removeFromList(streams_))); + read_callbacks_->connection().dispatcher().deferredDelete(stream.removeFromList(streams_)); } if (reset_stream && !(codec_->features() & CodecFeatures::Multiplexing)) { @@ -642,7 +641,7 @@ void ConnectionManagerImpl::ActiveStream::onResetStream(StreamResetReason) { } connection_manager_.read_callbacks_->connection().dispatcher().deferredDelete( - std::move(removeFromList(connection_manager_.streams_))); + removeFromList(connection_manager_.streams_)); } void ConnectionManagerImpl::ActiveStreamFilterBase::addResetStreamCallback( diff --git a/source/common/http/http2/codec_impl.cc b/source/common/http/http2/codec_impl.cc index cf99f1def24e..2ea79445dde3 100644 --- a/source/common/http/http2/codec_impl.cc +++ b/source/common/http/http2/codec_impl.cc @@ -401,7 +401,7 @@ int ConnectionImpl::onStreamClose(int32_t stream_id, uint32_t error_code) { : StreamResetReason::RemoteReset); } - connection_.dispatcher().deferredDelete(std::move(stream->removeFromList(active_streams_))); + connection_.dispatcher().deferredDelete(stream->removeFromList(active_streams_)); nghttp2_session_set_stream_user_data(session_, stream->stream_id_, nullptr); }