mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
One more time with a different cast?
This commit is contained in:
+2
-2
@@ -13,7 +13,7 @@ enum : MapIndex { MAP_SENTINEL = ~(MapIndex)0 };
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct PtrMapConstant {
|
struct PtrMapConstant {
|
||||||
static constexpr T const TOMBSTONE = (T)reinterpret_cast<void *>(~(uintptr)0);
|
static constexpr void const *TOMBSTONE = reinterpret_cast<void *>(~(uintptr)0);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
@@ -271,7 +271,7 @@ template <typename K, typename V>
|
|||||||
gb_internal void map_remove(PtrMap<K, V> *h, K key) {
|
gb_internal void map_remove(PtrMap<K, V> *h, K key) {
|
||||||
MapIndex found_index = 0;
|
MapIndex found_index = 0;
|
||||||
if (map_try_get(h, key, &found_index)) {
|
if (map_try_get(h, key, &found_index)) {
|
||||||
h->entries[found_index].key = PtrMapConstant<K>::TOMBSTONE;
|
h->entries[found_index].key = cast(K)PtrMapConstant<K>::TOMBSTONE;
|
||||||
h->count -= 1;
|
h->count -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user