libluna: Some fixes so that HashTable collisions work properly
This commit is contained in:
parent
4439ef8ec6
commit
16b385fc7b
@ -48,12 +48,13 @@ template <typename T> class HashTable
|
||||
usize i = index;
|
||||
|
||||
do {
|
||||
auto& bucket = m_buckets[index];
|
||||
auto& bucket = m_buckets[i];
|
||||
if (bucket.has_value())
|
||||
{
|
||||
if (*bucket == value) return bucket.value_ptr();
|
||||
i++;
|
||||
}
|
||||
else
|
||||
return nullptr;
|
||||
} while (i != index);
|
||||
|
||||
@ -70,7 +71,7 @@ template <typename T> class HashTable
|
||||
usize i = index;
|
||||
|
||||
do {
|
||||
auto& bucket = m_buckets[index];
|
||||
auto& bucket = m_buckets[i];
|
||||
if (bucket.has_value())
|
||||
{
|
||||
if (*bucket == value)
|
||||
@ -82,6 +83,7 @@ template <typename T> class HashTable
|
||||
}
|
||||
i++;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
} while (i != index);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user