mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-25 01:01:37 -05:00
Change Layer code not to create superfluous std::optional entries in LayerMap
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user