summaryrefslogtreecommitdiff
path: root/core/hashfuncs.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 13:23:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:54:55 +0200
commit0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch)
treea27e497da7104dd0a64f98a04fa3067668735e91 /core/hashfuncs.h
parent710b34b70227becdc652b4ae027fe0ac47409642 (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/hashfuncs.h')
-rw-r--r--core/hashfuncs.h7
1 files changed, 0 insertions, 7 deletions
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 <class T>
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 <class T>
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); }