Fixes StringViewDictionary::Remove(u32)
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-05-16 17:03:29 +02:00
parent 9dc7a0c6e3
commit dd2169bb02
2 changed files with 8 additions and 1 deletions

View File

@@ -108,7 +108,12 @@ namespace ArbUt {
inline void Remove(const StringView& key) { _map.erase(key); }
/// @brief Removes an item with a certain key hash from the dictionary
inline void Remove(u32 keyHash) { _map.erase(keyHash); }
inline void Remove(u32 keyHash) {
auto find = _map.find(keyHash);
if (find != _map.end()) {
_map.erase(find->first);
}
}
/// @brief Returns the number of items in the dictionary.
[[nodiscard]] inline size_t Count() const noexcept { return _map.size(); }