diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
tree | a27e497da7104dd0a64f98a04fa3067668735e91 /core/oa_hash_map.h | |
parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
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); |