22// / SPDX-License-Identifier: MIT
33
44#include < ice/config/config_builder.hxx>
5- #include < ice/container/hashmap .hxx>
5+ #include < ice/multi_hashmap .hxx>
66#include < ice/heap_string.hxx>
77#include < ice/heap_varstring.hxx>
88
@@ -47,20 +47,20 @@ namespace ice
4747 ice::u32 offset_strings;
4848 };
4949
50- auto cb_find_keystr_idx (ice::HashMap <CBKeyString> const & keystrings, ice::String keystr) noexcept -> ice::u32
50+ auto cb_find_keystr_idx (ice::MultiHashMap <CBKeyString> const & keystrings, ice::String keystr) noexcept -> ice::u32
5151 {
5252 ice::u64 const keystr_hash = ice::hash (keystr);
53- auto it = ice::multi_hashmap::find_first ( keystrings, keystr_hash);
53+ auto it = keystrings. find_values ( keystr_hash);
5454 while (it != nullptr && it.value ().value != keystr)
5555 {
56- it = ice::multi_hashmap::find_next (keystrings, it );
56+ it. next ( );
5757 }
5858
5959 return it == nullptr ? keystrings.size ().u32 () : it.value ().index ;
6060 }
6161
6262 auto cb_calculate_key_size (
63- ice::HashMap <CBKeyString>& keystrings,
63+ ice::MultiHashMap <CBKeyString>& keystrings,
6464 ice::config::detail::ConfigBuilderContainer const & config,
6565 ice::config::detail::ConfigBuilderEntry const * entry
6666 ) noexcept -> ice::usize
@@ -76,15 +76,15 @@ namespace ice
7676 // This allows us to reuse duplicate key names
7777 if (keystr_idx == keystrings.size ())
7878 {
79- ice::multi_hashmap:: insert (keystrings, ice::hash ( keystr) , { keystr, keystr_idx });
79+ keystrings. insert (keystr, { keystr, keystr_idx });
8080 result += { entry->size }; // Increase the size required
8181 }
8282 }
8383 return result;
8484 }
8585
8686 auto cb_calculate_final_size (
87- ice::HashMap <CBKeyString>& keystrings,
87+ ice::MultiHashMap <CBKeyString>& keystrings,
8888 ice::config::detail::ConfigBuilderContainer const & config,
8989 ice::usize& out_data_size,
9090 ice::u32 & out_count
@@ -138,7 +138,7 @@ namespace ice
138138 }
139139
140140 auto cb_calculate_final_size (
141- ice::HashMap <CBKeyString>& keystrings,
141+ ice::MultiHashMap <CBKeyString>& keystrings,
142142 ice::config::detail::ConfigBuilderContainer const & config,
143143 ice::u32 & out_count
144144 ) noexcept -> ice::usize
@@ -157,7 +157,7 @@ namespace ice
157157 }
158158
159159 auto cb_finalize_store_keysvalues (
160- ice::HashMap <CBKeyString>& keystrings,
160+ ice::MultiHashMap <CBKeyString>& keystrings,
161161 ice::Span<ice::u32 const > keystringoffsets,
162162 ice::config::detail::ConfigBuilderContainer const & config,
163163 ice::config::detail::ConfigKey* out_keylist,
@@ -377,7 +377,7 @@ namespace ice
377377 }
378378
379379 ice::Array<ice::u32 > keyoffsets{ alloc };
380- ice::HashMap <ice::CBKeyString> keystrings{ alloc };
380+ ice::MultiHashMap <ice::CBKeyString> keystrings{ alloc };
381381
382382 ice::u32 final_count = 0 ;
383383 ice::usize const final_size = cb_calculate_final_size (keystrings, container, final_count);
0 commit comments