From c2e7ee4f284bd4ed8de63f934838283365d2e0e0 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 1 Sep 2020 04:00:45 -0400 Subject: [PATCH] Change `settings::moduleWhitelist` from a map of vectors to a map of sets. --- include/settings.hpp | 3 ++- src/settings.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/settings.hpp b/include/settings.hpp index 11d19c77..ed378eb9 100644 --- a/include/settings.hpp +++ b/include/settings.hpp @@ -1,5 +1,6 @@ #pragma once #include +#include #include #include #include @@ -51,7 +52,7 @@ extern std::string patchPath; extern std::list recentPatchPaths; extern std::vector cableColors; // pluginSlug -> moduleSlugs -extern std::map> moduleWhitelist; +extern std::map> moduleWhitelist; json_t* toJson(); void fromJson(json_t* rootJ); diff --git a/src/settings.cpp b/src/settings.cpp index db58545f..7c36ec5d 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -49,7 +49,7 @@ std::vector cableColors = { color::fromHexString("#0f8df4ff"), // blue color::fromHexString("#8c1889ff"), // purple }; -std::map> moduleWhitelist = {}; +std::map> moduleWhitelist = {}; json_t* toJson() { @@ -238,7 +238,7 @@ void fromJson(json_t* rootJ) { json_t* moduleSlugJ; json_array_foreach(moduleSlugsJ, i, moduleSlugJ) { std::string moduleSlug = json_string_value(moduleSlugJ); - moduleSlugs.push_back(moduleSlug); + moduleSlugs.insert(moduleSlug); } } }