From 268a6948c0400905dfc335427395519689f067f5 Mon Sep 17 00:00:00 2001 From: hop311 Date: Mon, 22 Jan 2024 20:02:58 +0000 Subject: Added reserve_more, expect_dictionary_key[s|_map]_reserve_length[_and_default] --- src/openvic-simulation/pop/Culture.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/openvic-simulation/pop/Culture.cpp') diff --git a/src/openvic-simulation/pop/Culture.cpp b/src/openvic-simulation/pop/Culture.cpp index 53273f5..9466e9f 100644 --- a/src/openvic-simulation/pop/Culture.cpp +++ b/src/openvic-simulation/pop/Culture.cpp @@ -74,7 +74,8 @@ bool CultureManager::add_culture( } bool CultureManager::load_graphical_culture_type_file(ast::NodeCPtr root) { - const bool ret = expect_list_reserve_length(graphical_culture_types, + const bool ret = expect_list_reserve_length( + graphical_culture_types, expect_identifier(std::bind_front(&CultureManager::add_graphical_culture_type, this)) )(root); lock_graphical_culture_types(); @@ -169,7 +170,7 @@ bool CultureManager::load_culture_file(CountryManager const& country_manager, as } )(root); lock_culture_groups(); - cultures.reserve(cultures.size() + total_expected_cultures); + reserve_more_cultures(total_expected_cultures); ret &= expect_culture_group_dictionary( [this, &country_manager](CultureGroup const& culture_group, ast::NodeCPtr culture_group_value) -> bool { -- cgit v1.2.3-56-ga3b1