aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-05 16:46:09 +0000
committergingerBill <bill@gingerbill.org>2021-11-05 16:46:09 +0000
commitc38d6dc9592cff3bfd21c45076cd82df2d763eb2 (patch)
treef2e808711b957a36b53675ddd7c75e9ad0645c22 /src
parent924faa58b43b5e727436cd50bded45b9c43ac3a4 (diff)
Remove HashKey usage for `PtrMap` calls
Diffstat (limited to 'src')
-rw-r--r--src/ptr_map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ptr_map.cpp b/src/ptr_map.cpp
index 153b40b7e..4659fcf9b 100644
--- a/src/ptr_map.cpp
+++ b/src/ptr_map.cpp
@@ -237,7 +237,7 @@ gb_inline void map_clear(PtrMap<K, V> *h) {
#if PTR_MAP_ENABLE_MULTI_MAP
template <typename K, typename V>
-PtrMapEntry<K, V> *multi_map_find_first(PtrMap<K, V> *h, HashKey const &key) {
+PtrMapEntry<K, V> *multi_map_find_first(PtrMap<K, V> *h, K key) {
isize i = map__find(h, key).entry_index;
if (i == MAP_SENTINEL) {
return nullptr;
@@ -258,7 +258,7 @@ PtrMapEntry<K, V> *multi_map_find_next(PtrMap<K, V> *h, PtrMapEntry<K, V> *e) {
}
template <typename K, typename V>
-isize multi_map_count(PtrMap<K, V> *h, HashKey const &key) {
+isize multi_map_count(PtrMap<K, V> *h, K key) {
isize count = 0;
PtrMapEntry<K, V> *e = multi_map_find_first(h, key);
while (e != nullptr) {
@@ -302,7 +302,7 @@ void multi_map_insert(PtrMap<K, V> *h, K key, V const &value) {
}
template <typename K, typename V>
-void multi_map_remove(PtrMap<K, V> *h, HashKey const &key, PtrMapEntry<K, V> *e) {
+void multi_map_remove(PtrMap<K, V> *h, K key, PtrMapEntry<K, V> *e) {
MapFindResult fr = map__find_from_entry(h, e);
if (fr.entry_index != MAP_SENTINEL) {
map__erase(h, fr);
@@ -310,7 +310,7 @@ void multi_map_remove(PtrMap<K, V> *h, HashKey const &key, PtrMapEntry<K, V> *e)
}
template <typename K, typename V>
-void multi_map_remove_all(PtrMap<K, V> *h, HashKey const &key) {
+void multi_map_remove_all(PtrMap<K, V> *h, K key) {
while (map_get(h, key) != nullptr) {
map_remove(h, key);
}