From 160ab21e596574c84c69cde201df3e14ca95fc8a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 21 Nov 2017 14:15:29 +0100 Subject: [PATCH] Replace CheckResult::StaticInitialize with a lambda function --- lib/icinga/checkresult.cpp | 6 ++---- lib/icinga/checkresult.hpp | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/icinga/checkresult.cpp b/lib/icinga/checkresult.cpp index 8140db4bc..a577c4998 100644 --- a/lib/icinga/checkresult.cpp +++ b/lib/icinga/checkresult.cpp @@ -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 { diff --git a/lib/icinga/checkresult.hpp b/lib/icinga/checkresult.hpp index 508d0ff7e..eeade11c8 100644 --- a/lib/icinga/checkresult.hpp +++ b/lib/icinga/checkresult.hpp @@ -38,8 +38,6 @@ public: double CalculateExecutionTime(void) const; double CalculateLatency(void) const; - - static void StaticInitialize(void); }; }