diff --git a/Source/Core/Core/SysConf.cpp b/Source/Core/Core/SysConf.cpp index d9b3bb7907..b4e0b2834a 100644 --- a/Source/Core/Core/SysConf.cpp +++ b/Source/Core/Core/SysConf.cpp @@ -222,9 +222,9 @@ SysConf::Entry::Entry(Type type_, const std::string& name_, std::vector byte { } -void SysConf::AddEntry(Entry&& entry) +SysConf::Entry& SysConf::AddEntry(Entry&& entry) { - m_entries.emplace_back(std::move(entry)); + return m_entries.emplace_back(std::move(entry)); } SysConf::Entry* SysConf::GetEntry(std::string_view key) @@ -245,8 +245,8 @@ SysConf::Entry* SysConf::GetOrAddEntry(std::string_view key, Entry::Type type) { if (Entry* entry = GetEntry(key)) return entry; - AddEntry({type, std::string(key)}); - return GetEntry(key); + + return &AddEntry({type, std::string(key)}); } void SysConf::RemoveEntry(std::string_view key) diff --git a/Source/Core/Core/SysConf.h b/Source/Core/Core/SysConf.h index 592046a085..5eeeddb121 100644 --- a/Source/Core/Core/SysConf.h +++ b/Source/Core/Core/SysConf.h @@ -75,7 +75,7 @@ public: std::vector bytes; }; - void AddEntry(Entry&& entry); + Entry& AddEntry(Entry&& entry); Entry* GetEntry(std::string_view key); const Entry* GetEntry(std::string_view key) const; Entry* GetOrAddEntry(std::string_view key, Entry::Type type);