Update src/Common/Scheduler/Nodes/UnifiedSchedulerNode.h

Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
This commit is contained in:
Sergei Trifonov 2024-10-23 17:39:34 +02:00 committed by GitHub
parent 8675febee4
commit 533af5f3e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -173,11 +173,11 @@ private:
/// Returns root node if it has been changed to a different node, otherwise returns null.
[[nodiscard]] SchedulerNodePtr attachUnifiedChild(EventQueue * event_queue_, const UnifiedSchedulerNodePtr & child)
{
bool existing_branch = branches.contains(child->info.priority);
auto & child_branch = branches[child->info.priority];
auto [it, new_branch] = branches.try_emplace(child->info.priority);
auto & child_branch = it->second;
auto branch_root = child_branch.attachUnifiedChild(event_queue_, child);
if (existing_branch)
if (!new_branch)
{
if (branch_root)
{