Skip to content

Commit 9815696

Browse files
committed
SCHED: Avoid two instances of a double map lookup in the paging scheduler
1 parent 749e4f6 commit 9815696

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/scheduler/common_scheduling/paging_scheduler.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ void paging_scheduler::run_slot(cell_resource_allocator& res_grid)
113113
while (new_paging_notifications.try_pop(new_pg_info)) {
114114
// Check whether Paging information is already present or not. i.e. tackle repeated Paging attempt from upper
115115
// layers.
116-
if (paging_pending_ues.find(new_pg_info.paging_identity) == paging_pending_ues.cend()) {
117-
paging_pending_ues[new_pg_info.paging_identity] = ue_paging_info{.info = new_pg_info, .retry_count = 0};
118-
}
116+
paging_pending_ues.try_emplace(new_pg_info.paging_identity, ue_paging_info{.info = new_pg_info, .retry_count = 0});
119117
}
120118

121119
// NOTE:
@@ -140,7 +138,7 @@ void paging_scheduler::run_slot(cell_resource_allocator& res_grid)
140138
// Check for maximum paging retries.
141139
auto it = paging_pending_ues.begin();
142140
while (it != paging_pending_ues.end()) {
143-
if (paging_pending_ues[it->first].retry_count >= expert_cfg.pg.max_paging_retries) {
141+
if (it->second.retry_count >= expert_cfg.pg.max_paging_retries) {
144142
it = paging_pending_ues.erase(it);
145143
} else {
146144
++it;

0 commit comments

Comments
 (0)