From d9955ab35b8ea82e1c63cf3e20044bd6119a65dc Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 11 Aug 2022 12:05:45 +0300 Subject: [PATCH] locator: effective_replication_map: provide non-smart-pointer accessor to token_metadata token_metadata is protected by holders of an effective_replication_map_ptr, so it's just as safe and less expensive for them to obtain a reference to token_metadata rather than a smart pointer, so give them that option with a new accessor. --- locator/abstract_replication_strategy.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locator/abstract_replication_strategy.hh b/locator/abstract_replication_strategy.hh index 3bc0808627..d6bfadac65 100644 --- a/locator/abstract_replication_strategy.hh +++ b/locator/abstract_replication_strategy.hh @@ -172,6 +172,10 @@ public: effective_replication_map(effective_replication_map&&) = default; ~effective_replication_map(); + const token_metadata& get_token_metadata() const noexcept { + return *_tmptr; + } + const token_metadata_ptr& get_token_metadata_ptr() const noexcept { return _tmptr; }