minor refactoring
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 29 Aug 2017 20:55:33 +0000 (23:55 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 29 Aug 2017 20:55:33 +0000 (23:55 +0300)
src/server/core/netobj.cpp

index 5447fca..dc3802b 100644 (file)
@@ -826,9 +826,7 @@ void NetObj::calculateCompoundStatus(BOOL bForcedRecalc)
       return;
 
    int mostCriticalAlarm = GetMostCriticalStatusForObject(m_id);
-   int mostCriticalDCI =
-      (getObjectClass() == OBJECT_NODE || getObjectClass() == OBJECT_MOBILEDEVICE || getObjectClass() == OBJECT_CLUSTER || getObjectClass() == OBJECT_ACCESSPOINT || getObjectClass() == OBJECT_SENSOR) ?
-         ((DataCollectionTarget *)this)->getMostCriticalDCIStatus() : STATUS_UNKNOWN;
+   int mostCriticalDCI = isDataCollectionTarget() ? ((DataCollectionTarget *)this)->getMostCriticalDCIStatus() : STATUS_UNKNOWN;
 
    int oldStatus = m_status;
    int mostCriticalStatus, i, count, iStatusAlg;