mirror of https://github.com/Icinga/icinga2.git
Replace CheckResult::StaticInitialize with a lambda function
This commit is contained in:
parent
f7b4e81ffd
commit
160ab21e59
|
@ -24,10 +24,8 @@
|
|||
using namespace icinga;
|
||||
|
||||
REGISTER_TYPE(CheckResult);
|
||||
INITIALIZE_ONCE(&CheckResult::StaticInitialize);
|
||||
|
||||
void CheckResult::StaticInitialize(void)
|
||||
{
|
||||
INITIALIZE_ONCE([]() {
|
||||
ScriptGlobal::Set("ServiceOK", ServiceOK);
|
||||
ScriptGlobal::Set("ServiceWarning", ServiceWarning);
|
||||
ScriptGlobal::Set("ServiceCritical", ServiceCritical);
|
||||
|
@ -35,7 +33,7 @@ void CheckResult::StaticInitialize(void)
|
|||
|
||||
ScriptGlobal::Set("HostUp", HostUp);
|
||||
ScriptGlobal::Set("HostDown", HostDown);
|
||||
}
|
||||
})
|
||||
|
||||
double CheckResult::CalculateExecutionTime(void) const
|
||||
{
|
||||
|
|
|
@ -38,8 +38,6 @@ public:
|
|||
|
||||
double CalculateExecutionTime(void) const;
|
||||
double CalculateLatency(void) const;
|
||||
|
||||
static void StaticInitialize(void);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue