]> granicus.if.org Git - icinga2/commitdiff
Clean up the code a bit
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 13 Aug 2016 19:43:59 +0000 (21:43 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sat, 13 Aug 2016 19:43:59 +0000 (21:43 +0200)
refs #11423

lib/icinga/downtime.cpp

index 24b5312141ec0b561323cf3af9cf219679981f90..c1accacfb4eee23575284efec091afca29204580 100644 (file)
@@ -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)