refactor: create one type for slots set #2459 (#2645)

* refactor: create one type for slot ranges #2459
This commit is contained in:
Borys 2024-02-23 14:10:42 +02:00 committed by GitHub
parent bcae2dfb46
commit 8771ab32a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 148 additions and 111 deletions

View file

@ -702,7 +702,7 @@ void DbSlice::FlushSlotsFb(const SlotSet& slot_ids) {
auto del_entry_cb = [&](PrimeTable::iterator it) {
std::string_view key = it->first.GetSlice(&tmp);
SlotId sid = ClusterConfig::KeySlot(key);
if (slot_ids.contains(sid) && it.GetVersion() < next_version) {
if (slot_ids.Contains(sid) && it.GetVersion() < next_version) {
PerformDeletion(it, db_arr_[0].get());
}
return true;
@ -1439,7 +1439,7 @@ void DbSlice::InvalidateDbWatches(DbIndex db_indx) {
void DbSlice::InvalidateSlotWatches(const SlotSet& slot_ids) {
for (const auto& [key, conn_list] : db_arr_[0]->watched_keys) {
SlotId sid = ClusterConfig::KeySlot(key);
if (!slot_ids.contains(sid)) {
if (!slot_ids.Contains(sid)) {
continue;
}
for (auto conn_ptr : conn_list) {