From c8f970e2b04709280ef144ff135dac15945d21b2 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sun, 29 Oct 2017 19:17:58 +0000 Subject: Config: Remove recursive layer --- Source/Core/Common/Config/Config.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'Source/Core/Common/Config/Config.cpp') diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index 339155dbe3..eb763c3632 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -17,11 +17,6 @@ static std::list s_callbacks; void InvokeConfigChangedCallbacks(); -Section* GetOrCreateSection(System system, const std::string& section_name) -{ - return s_layers[LayerType::Meta]->GetOrCreateSection(system, section_name); -} - Layers* GetLayers() { return &s_layers; @@ -83,8 +78,6 @@ void Init() { // These layers contain temporary values ClearCurrentRunLayer(); - // This layer always has to exist - s_layers[LayerType::Meta] = std::make_unique(); } void Shutdown() @@ -129,7 +122,6 @@ const std::string& GetLayerName(LayerType layer) {LayerType::Movie, "Movie"}, {LayerType::CommandLine, "Command Line"}, {LayerType::CurrentRun, "Current Run"}, - {LayerType::Meta, "Top"}, }; return layer_to_name.at(layer); } -- cgit v1.2.3 From ec7b84c5f2f68ce8aae35c2dc12854117414f72b Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 30 Oct 2017 16:22:37 +0000 Subject: Config: Extract ConfigInfo into own header --- Source/Core/Common/Config/Config.cpp | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'Source/Core/Common/Config/Config.cpp') diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index eb763c3632..abb2304749 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -126,21 +126,6 @@ const std::string& GetLayerName(LayerType layer) return layer_to_name.at(layer); } -bool ConfigLocation::operator==(const ConfigLocation& other) const -{ - return std::tie(system, section, key) == std::tie(other.system, other.section, other.key); -} - -bool ConfigLocation::operator!=(const ConfigLocation& other) const -{ - return !(*this == other); -} - -bool ConfigLocation::operator<(const ConfigLocation& other) const -{ - return std::tie(system, section, key) < std::tie(other.system, other.section, other.key); -} - LayerType GetActiveLayerForConfig(const ConfigLocation& config) { for (auto layer : SEARCH_ORDER) -- cgit v1.2.3 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/Common/Config/Config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/Config/Config.cpp') diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp index abb2304749..a3504f80d2 100644 --- a/Source/Core/Common/Config/Config.cpp +++ b/Source/Core/Common/Config/Config.cpp @@ -133,7 +133,7 @@ LayerType GetActiveLayerForConfig(const ConfigLocation& config) if (!LayerExists(layer)) continue; - if (GetLayer(layer)->Exists(config.system, config.section, config.key)) + if (GetLayer(layer)->Exists(config)) return layer; } -- cgit v1.2.3