From 7cdbb7951a3c5d424e899bb0a6346e40167c491c Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Mon, 14 Jun 2021 09:34:40 +0200 Subject: [PATCH] db,view: explicitly move the mutation to its helper function The `apply_to_remote_endpoints` helper function used to take its `mut` parameter by reference, but then moved the value from it, which is confusing and prone to errors. Since the value is moved-from, let's pass it to the helper function as rvalue ref explicitly. --- db/view/view.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/view/view.cc b/db/view/view.cc index d76188e384..1990a70579 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -1175,7 +1175,7 @@ get_view_natural_endpoint(const sstring& keyspace_name, } static future<> apply_to_remote_endpoints(gms::inet_address target, inet_address_vector_topology_change&& pending_endpoints, - frozen_mutation_and_schema& mut, const dht::token& base_token, const dht::token& view_token, + frozen_mutation_and_schema&& mut, const dht::token& base_token, const dht::token& view_token, service::allow_hints allow_hints, tracing::trace_state_ptr tr_state) { tracing::trace(tr_state, "Sending view update for {}.{} to {}, with pending endpoints = {}; base token = {}; view token = {}", @@ -1294,7 +1294,7 @@ future<> mutate_MV( size_t updates_pushed_remote = remote_endpoints.size() + 1; stats.view_updates_pushed_remote += updates_pushed_remote; cf_stats.total_view_updates_pushed_remote += updates_pushed_remote; - future<> view_update = apply_to_remote_endpoints(*target_endpoint, std::move(remote_endpoints), mut, base_token, view_token, allow_hints, tr_state).then_wrapped( + future<> view_update = apply_to_remote_endpoints(*target_endpoint, std::move(remote_endpoints), std::move(mut), base_token, view_token, allow_hints, tr_state).then_wrapped( [target_endpoint, updates_pushed_remote, maybe_account_failure = std::move(maybe_account_failure)] (future<>&& f) mutable {