Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pessimizing std::move() calls. #132

Merged
merged 1 commit into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/common/http/access_log/access_log_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/access_log/access_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/codec_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
5 changes: 2 additions & 3 deletions source/common/http/conn_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/http2/codec_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down