From 3c25d035484eada675d9d0243a66d1b3e6b97808 Mon Sep 17 00:00:00 2001 From: hop311 Date: Sat, 21 Sep 2024 23:56:01 +0100 Subject: Cache static modifiers in dedicated variables --- src/openvic-simulation/modifier/Modifier.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/openvic-simulation/modifier/Modifier.cpp') diff --git a/src/openvic-simulation/modifier/Modifier.cpp b/src/openvic-simulation/modifier/Modifier.cpp index 16a4479..ec4aa08 100644 --- a/src/openvic-simulation/modifier/Modifier.cpp +++ b/src/openvic-simulation/modifier/Modifier.cpp @@ -448,7 +448,7 @@ bool ModifierManager::add_static_modifier(std::string_view identifier, ModifierV } bool ModifierManager::load_static_modifiers(ast::NodeCPtr root) { - const bool ret = expect_dictionary_reserve_length( + bool ret = expect_dictionary_reserve_length( static_modifiers, [this](std::string_view key, ast::NodeCPtr value) -> bool { ModifierValue modifier_value; @@ -460,6 +460,8 @@ bool ModifierManager::load_static_modifiers(ast::NodeCPtr root) { lock_static_modifiers(); + ret &= static_modifier_cache.load_static_modifiers(*this); + return ret; } -- cgit v1.2.3-56-ga3b1