diff options
author | Spartan322 <Megacake1234@gmail.com> | 2024-07-06 16:40:57 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2024-07-18 04:20:15 +0200 |
commit | d236dcf30c001e540377184565f4d173ed56f76e (patch) | |
tree | 3f2a270b5b85f91a22289091084a30c105f10f4d /src/openvic-simulation/dataloader/NodeTools.hpp | |
parent | 93d095ba30747c7158882668577c854be7ea39a1 (diff) |
Optimize some string interning casesoptimize/string-interning
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r-- | src/openvic-simulation/dataloader/NodeTools.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp index acf5a41..30cba65 100644 --- a/src/openvic-simulation/dataloader/NodeTools.hpp +++ b/src/openvic-simulation/dataloader/NodeTools.hpp @@ -5,6 +5,7 @@ #include <optional> #include <type_traits> +#include <openvic-dataloader/detail/SymbolIntern.hpp> #include <openvic-dataloader/v2script/AbstractSyntaxTree.hpp> #include <tsl/ordered_set.h> @@ -173,6 +174,10 @@ namespace OpenVic { node_callback_t expect_length(callback_t<size_t> callback); node_callback_t expect_key( + ovdl::symbol<char> key, node_callback_t callback, bool* key_found = nullptr, bool allow_duplicates = false + ); + + node_callback_t expect_key( std::string_view key, node_callback_t callback, bool* key_found = nullptr, bool allow_duplicates = false ); @@ -269,14 +274,10 @@ namespace OpenVic { return ret; } - template<StringMapCase Case> - constexpr bool add_key_map_entries(template_key_map_t<Case>& key_map) { + template<IsOrderedMap Map> + constexpr bool add_key_map_entries(Map&& key_map) { return true; } - template<StringMapCase Case> - constexpr bool add_key_map_entries(template_key_map_t<Case>&& key_map) { - return add_key_map_entries(key_map); - } template<IsOrderedMap Map, typename... Args> bool add_key_map_entries( |