From c9f500ef0169cd7243d80532df3a5689dec62a8d Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 30 Apr 2021 10:16:15 -0500 Subject: [PATCH] std::move strings to avoid copy --- plugins/amqp_trx_plugin/amqp_trx_plugin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/amqp_trx_plugin/amqp_trx_plugin.cpp b/plugins/amqp_trx_plugin/amqp_trx_plugin.cpp index 9d7c28d7f79..37ea836011e 100644 --- a/plugins/amqp_trx_plugin/amqp_trx_plugin.cpp +++ b/plugins/amqp_trx_plugin/amqp_trx_plugin.cpp @@ -134,7 +134,7 @@ struct amqp_trx_plugin_impl : std::enable_shared_from_this trx_queue_ptr->push( trx, [my=shared_from_this(), token=trx_trace.get_token(), delivery_tag, reply_to, correlation_id, trx] - (const std::variant& result) { + (const std::variant& result) mutable { auto trx_span = fc_create_span_from_token(token, "Processed"); fc_add_tag(trx_span, "trx_id", trx->id()); @@ -142,7 +142,7 @@ struct amqp_trx_plugin_impl : std::enable_shared_from_this if( std::holds_alternative(result) ) { auto& eptr = std::get(result); if( !reply_to.empty() ) { - my->trace_plug.publish_error( reply_to, correlation_id, eptr->code(), eptr->to_string() ); + my->trace_plug.publish_error( std::move(reply_to), std::move(correlation_id), eptr->code(), eptr->to_string() ); } fc_add_tag(trx_span, "error", eptr->to_string()); dlog( "accept_transaction ${id} exception: ${e}", ("id", trx->id())("e", eptr->to_string()) ); @@ -152,7 +152,7 @@ struct amqp_trx_plugin_impl : std::enable_shared_from_this } else { auto& trace = std::get(result); if( !reply_to.empty() ) { - my->trace_plug.publish_result( reply_to, correlation_id, trx, trace ); + my->trace_plug.publish_result( std::move(reply_to), std::move(correlation_id), trx, trace ); } fc_add_tag(trx_span, "block_num", trace->block_num); fc_add_tag(trx_span, "block_time", trace->block_time.to_time_point());