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:
PeterN
2023-06-05 19:29:52 +01:00
committed by GitHub
parent 3b1407d240
commit 64d6ad50f9
8 changed files with 51 additions and 41 deletions

View File

@@ -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();
};