Codechange: Split GetItem with GetOrCreateItem. (#10952)
`IniGroup::GetItem()` returns nullptr if the item does not exist, but does not if the create parameter is set to true. Resolve CodeQL warnings with `GetOrCreateItem()` which returns a reference to the item instead.
This commit is contained in:
@@ -44,7 +44,8 @@ struct IniGroup {
|
||||
IniGroup(struct IniLoadFile *parent, const std::string &name);
|
||||
~IniGroup();
|
||||
|
||||
IniItem *GetItem(const std::string &name, bool create);
|
||||
IniItem *GetItem(const std::string &name);
|
||||
IniItem &GetOrCreateItem(const std::string &name);
|
||||
void RemoveItem(const std::string &name);
|
||||
void Clear();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user