Alos add a const version of lookup_ptr for OAHashMap, similar to 62e9044837 .

This commit is contained in:
Relintai 2022-07-26 15:09:11 +02:00
parent dacb9e650f
commit 1e0353e179

View File

@ -236,7 +236,18 @@ public:
return false; return false;
} }
TValue *lookup_ptr(const TKey &p_key) const { const TValue *lookup_ptr(const TKey &p_key) const {
uint32_t pos = 0;
bool exists = _lookup_pos(p_key, pos);
if (exists) {
return &values[pos];
}
return nullptr;
}
TValue *lookup_ptr(const TKey &p_key) {
uint32_t pos = 0; uint32_t pos = 0;
bool exists = _lookup_pos(p_key, pos); bool exists = _lookup_pos(p_key, pos);