diff options
author | hop311 <hop3114@gmail.com> | 2024-09-22 00:56:01 +0200 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-10-05 21:33:04 +0200 |
commit | 3c25d035484eada675d9d0243a66d1b3e6b97808 (patch) | |
tree | 8124322cdd03cb54313ef27da86c699109e4430b /src/openvic-simulation/modifier/Modifier.cpp | |
parent | 2bfd651778bff970991f3bd320a78a4008959b4a (diff) |
Cache static modifiers in dedicated variables
Diffstat (limited to 'src/openvic-simulation/modifier/Modifier.cpp')
-rw-r--r-- | src/openvic-simulation/modifier/Modifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |