mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-09 17:49:01 +00:00
Change Layer code not to create superfluous std::optional entries in LayerMap
This commit is contained in:
parent
cb4eecde52
commit
48a4b62125
2 changed files with 17 additions and 11 deletions
|
@ -46,8 +46,14 @@ bool Layer::Exists(const ConfigLocation& location) const
|
|||
bool Layer::DeleteKey(const ConfigLocation& location)
|
||||
{
|
||||
m_is_dirty = true;
|
||||
bool had_value = m_map[location].has_value();
|
||||
m_map[location].reset();
|
||||
bool had_value = false;
|
||||
const auto iter = m_map.find(location);
|
||||
if (iter != m_map.end() && iter->second.has_value())
|
||||
{
|
||||
iter->second.reset();
|
||||
had_value = true;
|
||||
}
|
||||
|
||||
return had_value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue