]> granicus.if.org Git - icinga2/blobdiff - lib/base/boolean-script.cpp
Merge pull request #6718 from Icinga/bugfix/ssl-shutdown
[icinga2] / lib / base / boolean-script.cpp
index e0da2e9bc8be4dce01d0d0e3757dabce4737bc36..aab8ff0e5cb8b148657b905e0ab3bd2a2fd4dbe0 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012-2018 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                *
@@ -34,12 +34,9 @@ static String BooleanToString()
 
 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;
 }