From c7639f53e046e6b52ea7c4cf736a78cd44cbb430 Mon Sep 17 00:00:00 2001 From: Duarte Nunes Date: Sat, 6 Oct 2018 21:37:03 +0100 Subject: [PATCH] service/storage_proxy: Build a shared_mutation from a frozen_mutation Signed-off-by: Duarte Nunes --- service/storage_proxy.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/service/storage_proxy.cc b/service/storage_proxy.cc index f2c560dcdf..c605dcd36c 100644 --- a/service/storage_proxy.cc +++ b/service/storage_proxy.cc @@ -171,10 +171,13 @@ public: class shared_mutation : public mutation_holder { lw_shared_ptr _mutation; public: - shared_mutation(const mutation& m) : _mutation(make_lw_shared(freeze(m))) { + explicit shared_mutation(frozen_mutation_and_schema&& fm_a_s) + : _mutation(make_lw_shared(std::move(fm_a_s.fm))) { _size = _mutation->representation().size(); - _schema = m.schema(); - }; + _schema = std::move(fm_a_s.s); + } + explicit shared_mutation(const mutation& m) : shared_mutation(frozen_mutation_and_schema{freeze(m), m.schema()}) { + } lw_shared_ptr get_mutation_for(gms::inet_address ep) override { return _mutation; }