[icinga-checkins] icinga.org: icinga2/master: Clean up the code a bit

git at icinga.org git at icinga.org
Sat Aug 13 21:44:17 CEST 2016


Module: icinga2
Branch: master
Commit: 9f8cb8dd361c066c3cc4dbe8987617d44e04e296
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=9f8cb8dd361c066c3cc4dbe8987617d44e04e296

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Aug 13 21:43:59 2016 +0200

Clean up the code a bit

refs #11423

---

 lib/icinga/downtime.cpp |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp
index 24b5312..c1accac 100644
--- a/lib/icinga/downtime.cpp
+++ b/lib/icinga/downtime.cpp
@@ -200,12 +200,7 @@ bool Downtime::IsExpired(void) const
 bool Downtime::HasValidConfigOwner(void) const
 {
 	String configOwner = GetConfigOwner();
-
-	if (!configOwner.IsEmpty()) {
-		return (GetObject("ScheduledDowntime", configOwner) != ScheduledDowntime::Ptr());
-	}
-
-	return true;
+	return configOwner.IsEmpty() || GetObject<ScheduledDowntime>(configOwner);
 }
 
 int Downtime::GetNextDowntimeID(void)



More information about the icinga-checkins mailing list