mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
chore(acl_family): Move some variables outside loop (#4975)
Signed-off-by: Abhijat Malviya <abhijat@dragonflydb.io>
This commit is contained in:
parent
1b0aa56028
commit
ff8bf7817a
1 changed files with 5 additions and 5 deletions
|
@ -1189,16 +1189,16 @@ void AclFamily::BuildIndexers(RevCommandsIndexStore families) {
|
|||
acl::NumberOfFamilies(families.size());
|
||||
CommandsRevIndexer(std::move(families));
|
||||
CategoryToCommandsIndexStore index;
|
||||
cmd_registry_->Traverse([&](std::string_view name, auto& cid) {
|
||||
auto cat = cid.acl_categories();
|
||||
cmd_registry_->Traverse([&](std::string_view, auto& cid) {
|
||||
const uint32_t cat = cid.acl_categories();
|
||||
const size_t family = cid.GetFamily();
|
||||
const uint64_t bit_index = cid.GetBitIndex();
|
||||
for (size_t i = 0; i < 32; ++i) {
|
||||
if (cat & (1 << i)) {
|
||||
if (cat & 1 << i) {
|
||||
std::string_view cat_name = reverse_cat_table_[i];
|
||||
if (index[cat_name].empty()) {
|
||||
index[cat_name].resize(CommandsRevIndexer().size());
|
||||
}
|
||||
auto family = cid.GetFamily();
|
||||
auto bit_index = cid.GetBitIndex();
|
||||
index[cat_name][family] |= bit_index;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue