From 0c848e9a4e4f16d82014c137aabf3adaedf4cc89 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 7 Jul 2015 12:45:58 +0300 Subject: [PATCH] rpc: add missing move()s in get_reply() If the reply is a movable-but-not-copyable type, then we must move it into the returned future. Also faster even if the type is copyable. --- rpc/rpc_impl.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/rpc_impl.hh b/rpc/rpc_impl.hh index b7c4223eeb..418499cde0 100644 --- a/rpc/rpc_impl.hh +++ b/rpc/rpc_impl.hh @@ -156,7 +156,7 @@ template struct rcv_reply : rcv_reply_base { inline future<> get_reply(typename protocol::client& dst) { return unmarshall(dst.serializer(), dst.in(), std::tie(this->u.v)).then([this] { - this->set_value(this->u.v); + this->set_value(std::move(this->u.v)); }); } }; @@ -165,7 +165,7 @@ template struct rcv_reply> : rcv_reply_base, T...> { inline future<> get_reply(typename protocol::client& dst) { return unmarshall(dst.serializer(), dst.in(), ref_tuple(this->u.v)).then([this] { - this->set_value(this->u.v); + this->set_value(std::move(this->u.v)); }); } };