From 12e3e4fb2adfe96dd5933833c0acd40b8ed4e695 Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov Date: Tue, 5 Jun 2018 13:48:11 -0400 Subject: [PATCH] service::client_state::has_access(): make readable_system_resources an std::unordered_set There is not reason to use an std::set for it since we don't care about the ordering - only about the existance of a particular entry. Hash table will be more efficient for this use case. Signed-off-by: Vlad Zolotarov Message-Id: <1528220892-5784-2-git-send-email-vladz@scylladb.com> --- service/client_state.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/client_state.cc b/service/client_state.cc index 754fcea202..61cfb32265 100644 --- a/service/client_state.cc +++ b/service/client_state.cc @@ -176,8 +176,8 @@ future<> service::client_state::has_access(const sstring& ks, auth::permission p } } - static thread_local std::set readable_system_resources = [] { - std::set tmp; + static thread_local std::unordered_set readable_system_resources = [] { + std::unordered_set tmp; for (auto cf : { db::system_keyspace::LOCAL, db::system_keyspace::PEERS }) { tmp.insert(auth::make_data_resource(db::system_keyspace::NAME, cf)); }