mirror of https://github.com/Icinga/icinga2.git
Apply clang-tidy fix 'modernize-return-braced-init-list'
This commit is contained in:
parent
e0c350b8a5
commit
e0174b8f3f
|
@ -58,7 +58,7 @@ int ObjectType::GetFieldId(const String& name) const
|
|||
Field ObjectType::GetFieldInfo(int id) const
|
||||
{
|
||||
if (id == 0)
|
||||
return Field(1, "String", "type", nullptr, nullptr, 0, 0);
|
||||
return {1, "String", "type", nullptr, nullptr, 0, 0};
|
||||
else
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ Field TypeType::GetFieldInfo(int id) const
|
|||
return GetBaseType()->GetFieldInfo(id);
|
||||
|
||||
if (real_id == 0)
|
||||
return Field(0, "String", "name", "", nullptr, 0, 0);
|
||||
return {0, "String", "name", "", nullptr, 0, 0};
|
||||
else if (real_id == 1)
|
||||
return Field(1, "Object", "prototype", "", nullptr, 0, 0);
|
||||
else if (real_id == 2)
|
||||
|
|
|
@ -296,7 +296,7 @@ DbReference DbConnection::GetObjectID(const DbObject::Ptr& dbobj) const
|
|||
auto it = m_ObjectIDs.find(dbobj);
|
||||
|
||||
if (it == m_ObjectIDs.end())
|
||||
return DbReference();
|
||||
return {};
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ DbReference DbConnection::GetInsertID(const DbObject::Ptr& dbobj) const
|
|||
DbReference DbConnection::GetInsertID(const DbType::Ptr& type, const DbReference& objid) const
|
||||
{
|
||||
if (!objid.IsValid())
|
||||
return DbReference();
|
||||
return {};
|
||||
|
||||
auto it = m_InsertIDs.find(std::make_pair(type, objid));
|
||||
|
||||
|
|
|
@ -654,7 +654,7 @@ DbReference IdoMysqlConnection::GetLastInsertID()
|
|||
{
|
||||
AssertOnWorkQueue();
|
||||
|
||||
return DbReference(m_Mysql->insert_id(&m_Connection));
|
||||
return {m_Mysql->insert_id(&m_Connection)};
|
||||
}
|
||||
|
||||
int IdoMysqlConnection::GetAffectedRows()
|
||||
|
|
|
@ -498,7 +498,7 @@ DbReference IdoPgsqlConnection::GetSequenceValue(const String& table, const Stri
|
|||
Log(LogDebug, "IdoPgsqlConnection")
|
||||
<< "Sequence Value: " << row->Get("id");
|
||||
|
||||
return DbReference(Convert::ToLong(row->Get("id")));
|
||||
return {Convert::ToLong(row->Get("id"))};
|
||||
}
|
||||
|
||||
int IdoPgsqlConnection::GetAffectedRows()
|
||||
|
|
|
@ -359,7 +359,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
|
|||
nameref = "nullptr";
|
||||
|
||||
m_Impl << "\t\t" << "case " << num << ":" << std::endl
|
||||
<< "\t\t\t" << "return Field(" << num << ", \"" << ftype << "\", \"" << field.Name << "\", \"" << (field.NavigationName.empty() ? field.Name : field.NavigationName) << "\", " << nameref << ", " << field.Attributes << ", " << field.Type.ArrayRank << ");" << std::endl;
|
||||
<< "\t\t\t" << "return {" << num << ", \"" << ftype << "\", \"" << field.Name << "\", \"" << (field.NavigationName.empty() ? field.Name : field.NavigationName) << "\", " << nameref << ", " << field.Attributes << ", " << field.Type.ArrayRank << "};" << std::endl;
|
||||
num++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue