From be3b34fcea6512c8e5c4e170c50caaa7f14bb15a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 3 Nov 2020 18:43:19 +0000 Subject: Rename ConfigItems to ConfigTag::Items. --- src/users.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index cee201d0b..9be5cdada 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -1239,26 +1239,24 @@ ConnectClass::ConnectClass(std::shared_ptr tag, char t, const std::st // Connect classes can inherit from each other but this is problematic for modules which can't use // ConnectClass::Update so we build a hybrid tag containing all of the values set on this class as // well as the parent class. - ConfigItems* items = NULL; + ConfigTag::Items* items; config = ConfigTag::create(tag->tag, tag->src_name, tag->src_line, items); - const ConfigItems& parentkeys = parent->config->getItems(); - for (ConfigItems::const_iterator piter = parentkeys.begin(); piter != parentkeys.end(); ++piter) + for (const auto& [key, value] : parent->config->GetItems()) { // The class name and parent name are not inherited - if (stdalgo::string::equalsci(piter->first, "name") || stdalgo::string::equalsci(piter->first, "parent")) + if (stdalgo::string::equalsci(key, "name") || stdalgo::string::equalsci(key, "parent")) continue; // Store the item in the config tag. If this item also // exists in the child it will be overwritten. - (*items)[piter->first] = piter->second; + (*items)[key] = value; } - const ConfigItems& childkeys = tag->getItems(); - for (ConfigItems::const_iterator citer = childkeys.begin(); citer != childkeys.end(); ++citer) + for (const auto& [key, value] : tag->GetItems()) { // This will overwrite the parent value if present. - (*items)[citer->first] = citer->second; + (*items)[key] = value; } } -- cgit v1.3.1-10-gc9f91