From 915ea6427e5ffb6826942ca00e1dab1afb177a23 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 10 Feb 2025 08:33:29 +0100 Subject: [PATCH] Use `GetParents()` in `FireSppressedNotifications()` It's way efficient than accessing them through the dependency objects, plus we won't have any duplicates. --- lib/icinga/checkable-notification.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/icinga/checkable-notification.cpp b/lib/icinga/checkable-notification.cpp index 2a1150556..282b95d32 100644 --- a/lib/icinga/checkable-notification.cpp +++ b/lib/icinga/checkable-notification.cpp @@ -167,8 +167,7 @@ void Checkable::FireSuppressedNotifications() } } - for (auto& dep : GetDependencies()) { - auto parent (dep->GetParent()); + for (auto& parent : GetParents()) { ObjectLock oLock (parent); if (!parent->GetProblem() && parent->GetLastStateChange() >= threshold) {