mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Config: Flatten structures
Originally, Layer contained a std::map of Sections, which containted a std::map containing the (key, value) pairs. Here we flattern this structure so that only one std::map is required, reducing the number of indirections required and vastly simplifying the code.
This commit is contained in:
@ -45,18 +45,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void Load(Config::Layer* config_layer) override
|
||||
void Load(Config::Layer* layer) override
|
||||
{
|
||||
for (auto& value : m_values)
|
||||
{
|
||||
const Config::ConfigLocation location = std::get<0>(value);
|
||||
Config::Section* section =
|
||||
config_layer->GetOrCreateSection(location.system, location.section);
|
||||
section->Set(location.key, std::get<1>(value));
|
||||
layer->Set(std::get<0>(value), std::get<1>(value));
|
||||
}
|
||||
}
|
||||
|
||||
void Save(Config::Layer* config_layer) override
|
||||
void Save(Config::Layer* layer) override
|
||||
{
|
||||
// Save Nothing
|
||||
}
|
||||
|
Reference in New Issue
Block a user