Преглед на файлове

HPCC-10821 minor changes

Move WsSMCStatusServerTypeNames definition close to WsSMCStatusServerType;
Check WsSMCSSTterm before testing a WsSMCStatusServerType.
Kevin Wang преди 11 години
родител
ревизия
9028ffab55
променени са 2 файла, в които са добавени 3 реда и са изтрити 5 реда
  1. 1 5
      esp/services/ws_smc/ws_smcService.cpp
  2. 2 0
      esp/services/ws_smc/ws_smcService.hpp

+ 1 - 5
esp/services/ws_smc/ws_smcService.cpp

@@ -1292,13 +1292,9 @@ bool CWsSMCEx::onActivity(IEspContext &context, IEspActivityRequest &req, IEspAc
     return true;
 }
 
-const char *WsSMCStatusServerTypeNames[] = { "ThorMaster", "RoxieServer", "HThorServer", "ECLagent" };
-
 const char *CWsSMCEx::getStatusServerTypeName(WsSMCStatusServerType type)
 {
-    if (type < sizeof(WsSMCStatusServerTypeNames)/sizeof(char *))
-        return WsSMCStatusServerTypeNames[type];
-    return NULL;
+    return (type < WsSMCSSTterm) ? WsSMCStatusServerTypeNames[type] : NULL;
 }
 
 void CWsSMCEx::readTargetClusterInfo(IEspContext &context, CConstWUClusterInfoArray& clusters, IPropertyTree* serverStatusRoot,

+ 2 - 0
esp/services/ws_smc/ws_smcService.hpp

@@ -50,6 +50,8 @@ enum WsSMCStatusServerType
     WsSMCSSTterm = 4
 };
 
+static const char *WsSMCStatusServerTypeNames[] = { "ThorMaster", "RoxieServer", "HThorServer", "ECLagent" };
+
 class CWsSMCQueue
 {
 public: