From efddf93a8e7c2d6af6c3f1be792f3c098010ee2a Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 23 Mar 2022 15:06:29 +0100 Subject: [PATCH] Added lookup_ptr method to OAHashMap. --- core/oa_hash_map.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h index 99fe2de6f..6c38e4d71 100644 --- a/core/oa_hash_map.h +++ b/core/oa_hash_map.h @@ -236,6 +236,17 @@ public: return false; } + 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; + } + _FORCE_INLINE_ bool has(const TKey &p_key) const { uint32_t _pos = 0; return _lookup_pos(p_key, _pos);