/******************************************************************************
* Icinga 2 *
- * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://icinga.com/) *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
using namespace icinga;
-static String BooleanToString(void)
+static String BooleanToString()
{
ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
bool self = vframe->Self;
return self ? "true" : "false";
}
-Object::Ptr Boolean::GetPrototype(void)
+Object::Ptr Boolean::GetPrototype()
{
- static Dictionary::Ptr prototype;
-
- if (!prototype) {
- prototype = new Dictionary();
- prototype->Set("to_string", new Function("Boolean#to_string", BooleanToString, {}, true));
- }
+ static Dictionary::Ptr prototype = new Dictionary({
+ { "to_string", new Function("Boolean#to_string", BooleanToString, {}, true) }
+ });
return prototype;
}