mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-02 14:15:46 +00:00
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.
This commit is contained in:
@@ -156,7 +156,7 @@ template<typename Serializer, typename MsgType, typename T>
|
||||
struct rcv_reply : rcv_reply_base<T, T> {
|
||||
inline future<> get_reply(typename protocol<Serializer, MsgType>::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<typename Serializer, typename MsgType, typename... T>
|
||||
struct rcv_reply<Serializer, MsgType, future<T...>> : rcv_reply_base<std::tuple<T...>, T...> {
|
||||
inline future<> get_reply(typename protocol<Serializer, MsgType>::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));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user