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/hashfuncs.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'core/hashfuncs.h') diff --git a/core/hashfuncs.h b/core/hashfuncs.h index a41a034843..ccecba5137 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -49,7 +49,6 @@ * @return 32-bits hashcode */ static inline uint32_t hash_djb2(const char *p_cstr) { - const unsigned char *chr = (const unsigned char *)p_cstr; uint32_t hash = 5381; uint32_t c; @@ -61,7 +60,6 @@ static inline uint32_t hash_djb2(const char *p_cstr) { } static inline uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len, uint32_t p_prev = 5381) { - uint32_t hash = p_prev; for (int i = 0; i < p_len; i++) @@ -71,7 +69,6 @@ static inline uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len, uint32 } static inline uint32_t hash_djb2_one_32(uint32_t p_in, uint32_t p_prev = 5381) { - return ((p_prev << 5) + p_prev) + p_in; } @@ -105,7 +102,6 @@ static inline uint32_t hash_djb2_one_float(double p_in, uint32_t p_prev = 5381) template static inline uint32_t make_uint32_t(T p_in) { - union { T t; uint32_t _u32; @@ -116,13 +112,11 @@ static inline uint32_t make_uint32_t(T p_in) { } static inline uint64_t hash_djb2_one_64(uint64_t p_in, uint64_t p_prev = 5381) { - return ((p_prev << 5) + p_prev) + p_in; } template static inline uint64_t make_uint64_t(T p_in) { - union { T t; uint64_t _u64; @@ -134,7 +128,6 @@ static inline uint64_t make_uint64_t(T p_in) { } struct HashMapHasherDefault { - static _FORCE_INLINE_ uint32_t hash(const String &p_string) { return p_string.hash(); } static _FORCE_INLINE_ uint32_t hash(const char *p_cstr) { return hash_djb2(p_cstr); } static _FORCE_INLINE_ uint32_t hash(const uint64_t p_int) { return hash_one_uint64(p_int); } -- cgit v1.2.3