From 42c9f35374d2809a51c597c36bf2263ba90219ad Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Tue, 6 Sep 2022 10:47:08 +0300 Subject: [PATCH] topology: Mark compare_endpoints() arguments as const Continuation to debfcc0e (snitch: Move sort_by_proximity() to topology). The passed addresses are not modified by the helper. They are not yet const because the method was copy-n-pasted from snitch where it wasn't such. tests: unit(dev) Signed-off-by: Pavel Emelyanov Message-Id: <20220906074708.29574-1-xemul@scylladb.com> --- locator/token_metadata.cc | 2 +- locator/token_metadata.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/locator/token_metadata.cc b/locator/token_metadata.cc index 12b00efb6c..461c01a7d1 100644 --- a/locator/token_metadata.cc +++ b/locator/token_metadata.cc @@ -1327,7 +1327,7 @@ void topology::sort_by_proximity(inet_address address, inet_address_vector_repli } } -int topology::compare_endpoints(inet_address& address, inet_address& a1, inet_address& a2) const { +int topology::compare_endpoints(const inet_address& address, const inet_address& a1, const inet_address& a2) const { // // if one of the Nodes IS the Node we are comparing to and the other one // IS NOT - then return the appropriate result. diff --git a/locator/token_metadata.hh b/locator/token_metadata.hh index cb0eab5ad7..736825e47d 100644 --- a/locator/token_metadata.hh +++ b/locator/token_metadata.hh @@ -107,7 +107,7 @@ private: * compares two endpoints in relation to the target endpoint, returning as * Comparator.compare would */ - int compare_endpoints(inet_address& address, inet_address& a1, inet_address& a2) const; + int compare_endpoints(const inet_address& address, const inet_address& a1, const inet_address& a2) const; /** multi-map: DC -> endpoints in that DC */ std::unordered_map