diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /core/oa_hash_map.h | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'core/oa_hash_map.h')
-rw-r--r-- | core/oa_hash_map.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/core/oa_hash_map.h b/core/oa_hash_map.h index b4d9ce4d51..e411ced044 100644 --- a/core/oa_hash_map.h +++ b/core/oa_hash_map.h @@ -50,7 +50,6 @@ template <class TKey, class TValue, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>> class OAHashMap { - private: TValue *values; TKey *keys; @@ -110,7 +109,6 @@ private: } void _insert_with_hash(uint32_t p_hash, const TKey &p_key, const TValue &p_value) { - uint32_t hash = p_hash; uint32_t distance = 0; uint32_t pos = hash % capacity; @@ -140,7 +138,6 @@ private: } void _resize_and_rehash(uint32_t p_new_capacity) { - uint32_t old_capacity = capacity; capacity = p_new_capacity; @@ -183,9 +180,7 @@ public: } void clear() { - for (uint32_t i = 0; i < capacity; i++) { - if (hashes[i] == EMPTY_HASH) { continue; } @@ -199,7 +194,6 @@ public: } void insert(const TKey &p_key, const TValue &p_value) { - if (num_elements + 1 > 0.9 * capacity) { _resize_and_rehash(); } @@ -317,7 +311,6 @@ public: } Iterator next_iter(const Iterator &p_iter) const { - if (!p_iter.valid) { return p_iter; } @@ -348,7 +341,6 @@ public: OAHashMap &operator=(const OAHashMap &) = delete; // Same for assignment operator. OAHashMap(uint32_t p_initial_capacity = 64) { - capacity = p_initial_capacity; keys = memnew_arr(TKey, p_initial_capacity); @@ -361,7 +353,6 @@ public: } ~OAHashMap() { - memdelete_arr(keys); memdelete_arr(values); memdelete_arr(hashes); |