Codechange: Split GetGroup into GetGroup/GetOrCreateGroup.
This follows the pattern used for GetItem/GetOrCreateItem, and allows use of references where we know the group must exist.
This commit is contained in:

committed by
Peter Nelson

parent
54b1a067eb
commit
6ce7195ef1
@@ -292,9 +292,9 @@ void HotkeyList::Load(IniFile &ini)
|
||||
*/
|
||||
void HotkeyList::Save(IniFile &ini) const
|
||||
{
|
||||
IniGroup *group = ini.GetGroup(this->ini_group);
|
||||
IniGroup &group = ini.GetOrCreateGroup(this->ini_group);
|
||||
for (const Hotkey &hotkey : this->items) {
|
||||
IniItem &item = group->GetOrCreateItem(hotkey.name);
|
||||
IniItem &item = group.GetOrCreateItem(hotkey.name);
|
||||
item.SetValue(SaveKeycodes(hotkey));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user