From cbab7649beb80128b9ac041bdfb41d7020f91099 Mon Sep 17 00:00:00 2001 From: mkrzewic Date: Tue, 30 Oct 2018 23:08:58 +0100 Subject: [PATCH] Return unique_ptr by value to allow RVO --- fairmq/MemoryResourceTools.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fairmq/MemoryResourceTools.h b/fairmq/MemoryResourceTools.h index fefab59b5..54e1084a7 100644 --- a/fairmq/MemoryResourceTools.h +++ b/fairmq/MemoryResourceTools.h @@ -46,13 +46,13 @@ FairMQMessagePtr getMessage(ContainerT &&container_, FairMQMemoryResource *targe container.data()))); if (message) message->SetUsedSize(containerSizeBytes); - return std::move(message); + return message; } else { auto message = targetResource->getTransportFactory()->CreateMessage(containerSizeBytes); std::memcpy(static_cast(message->GetData()), container.data(), containerSizeBytes); - return std::move(message); + return message; } };