mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00: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:
parent
f3b52c07d7
commit
4c24629b95
13 changed files with 220 additions and 551 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue