]> granicus.if.org Git - icinga2/blobdiff - lib/livestatus/commandstable.cpp
Remove more redundant wrappers from CompatUtility class
[icinga2] / lib / livestatus / commandstable.cpp
index fc1a1fb95c08e39a56043b838d679febba1e964d..6526486b1cced670a7fccc16e024c80e3734aa18 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)  *
+ * Copyright (C) 2012-2018 Icinga Development Team (https://www.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;
 
-CommandsTable::CommandsTable(void)
+CommandsTable::CommandsTable()
 {
        AddColumns(this);
 }
 
 void CommandsTable::AddColumns(Table *table, const String& prefix,
-    const Column::ObjectAccessor& objectAccessor)
+       const Column::ObjectAccessor& objectAccessor)
 {
        table->AddColumn(prefix + "name", Column(&CommandsTable::NameAccessor, objectAccessor));
        table->AddColumn(prefix + "line", Column(&CommandsTable::LineAccessor, objectAccessor));
@@ -47,12 +47,12 @@ void CommandsTable::AddColumns(Table *table, const String& prefix,
        table->AddColumn(prefix + "modified_attributes_list", Column(&Table::ZeroAccessor, objectAccessor));
 }
 
-String CommandsTable::GetName(void) const
+String CommandsTable::GetName() const
 {
        return "commands";
 }
 
-String CommandsTable::GetPrefix(void) const
+String CommandsTable::GetPrefix() const
 {
        return "command";
 }
@@ -106,11 +106,11 @@ Value CommandsTable::CustomVariableNamesAccessor(const Value& row)
                vars = CompatUtility::GetCustomAttributeConfig(command);
        }
 
-       if (!vars)
-               return Empty;
-
        Array::Ptr cv = new Array();
 
+       if (!vars)
+               return cv;
+
        {
                ObjectLock xlock(vars);
                for (const auto& kv : vars) {
@@ -135,11 +135,11 @@ Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
                vars = CompatUtility::GetCustomAttributeConfig(command);
        }
 
-       if (!vars)
-               return Empty;
-
        Array::Ptr cv = new Array();
 
+       if (!vars)
+               return cv;
+
        {
                ObjectLock xlock(vars);
                for (const auto& kv : vars) {
@@ -164,11 +164,11 @@ Value CommandsTable::CustomVariablesAccessor(const Value& row)
                vars = CompatUtility::GetCustomAttributeConfig(command);
        }
 
-       if (!vars)
-               return Empty;
-
        Array::Ptr cv = new Array();
 
+       if (!vars)
+               return cv;
+
        {
                ObjectLock xlock(vars);
                for (const auto& kv : vars) {