From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: 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. --- core/oa_hash_map.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'core/oa_hash_map.h') 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 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); -- cgit v1.2.3