From 4c24629b9551cab8af653a2bbcbe6d1639b3edb2 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 29 Oct 2017 19:11:15 +0000 Subject: 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. --- Source/Core/UICommon/CommandLineParse.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Source/Core/UICommon/CommandLineParse.cpp') diff --git a/Source/Core/UICommon/CommandLineParse.cpp b/Source/Core/UICommon/CommandLineParse.cpp index cf47bd8a5c..236cd86ba2 100644 --- a/Source/Core/UICommon/CommandLineParse.cpp +++ b/Source/Core/UICommon/CommandLineParse.cpp @@ -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 } -- cgit v1.2.3