aboutsummaryrefslogtreecommitdiff
path: root/src/ptr_set.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-02-20 08:47:48 +0000
committerGitHub <noreply@github.com>2025-02-20 08:47:48 +0000
commit82ddf358d0a319ba0eefd838bb80cf526daf9dcb (patch)
tree0d432e0952d0c207f186407bd06a610e7e74e6dc /src/ptr_set.cpp
parentf0b1357132de38e9dad0964ebe4c21db1ed4f430 (diff)
parent29456bcdea6e9567a9655e49a948f9e57920ff7a (diff)
Merge pull request #4855 from odin-lang/bill/canonical-type-hashing
Deterministic Canonical Naming for Link Names and Types
Diffstat (limited to 'src/ptr_set.cpp')
-rw-r--r--src/ptr_set.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ptr_set.cpp b/src/ptr_set.cpp
index ff4befc37..5097e2bb6 100644
--- a/src/ptr_set.cpp
+++ b/src/ptr_set.cpp
@@ -42,7 +42,7 @@ gb_internal void ptr_set_destroy(PtrSet<T> *s) {
template <typename T>
gb_internal isize ptr_set__find(PtrSet<T> *s, T ptr) {
- GB_ASSERT(ptr != nullptr);
+ GB_ASSERT(ptr != 0);
if (s->count != 0) {
#if 0
for (usize i = 0; i < s->capacity; i++) {
@@ -58,7 +58,7 @@ gb_internal isize ptr_set__find(PtrSet<T> *s, T ptr) {
T key = s->keys[hash_index];
if (key == ptr) {
return hash_index;
- } else if (key == nullptr) {
+ } else if (key == 0) {
return -1;
}
hash_index = (hash_index+1)&mask;
@@ -122,7 +122,7 @@ gb_internal bool ptr_set_update(PtrSet<T> *s, T ptr) { // returns true if it pre
for (usize i = 0; i < s->capacity; i++) {
T *key = &s->keys[hash_index];
GB_ASSERT(*key != ptr);
- if (*key == (T)PtrSet<T>::TOMBSTONE || *key == nullptr) {
+ if (*key == (T)PtrSet<T>::TOMBSTONE || *key == 0) {
*key = ptr;
s->count++;
return false;
@@ -169,7 +169,7 @@ struct PtrSetIterator {
return *this;
}
T key = set->keys[index];
- if (key != nullptr && key != (T)PtrSet<T>::TOMBSTONE) {
+ if (key != 0 && key != (T)PtrSet<T>::TOMBSTONE) {
return *this;
}
}
@@ -191,7 +191,7 @@ gb_internal PtrSetIterator<T> begin(PtrSet<T> &set) noexcept {
usize index = 0;
while (index < set.capacity) {
T key = set.keys[index];
- if (key != nullptr && key != (T)PtrSet<T>::TOMBSTONE) {
+ if (key != 0 && key != (T)PtrSet<T>::TOMBSTONE) {
break;
}
index++;