summaryrefslogtreecommitdiffstats
path: root/core/string_name.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/string_name.h
parent710b34b70227becdc652b4ae027fe0ac47409642 (diff)
downloadredot-engine-0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a.tar.gz
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/string_name.h')
-rw-r--r--core/string_name.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/core/string_name.h b/core/string_name.h
index 762eb43610..0517696ab1 100644
--- a/core/string_name.h
+++ b/core/string_name.h
@@ -36,13 +36,11 @@
#include "core/ustring.h"
struct StaticCString {
-
const char *ptr;
static StaticCString create(const char *p_ptr);
};
class StringName {
-
enum {
STRING_TABLE_BITS = 12,
@@ -68,7 +66,6 @@ class StringName {
_Data *_data = nullptr;
union _HashUnion {
-
_Data *ptr;
uint32_t hash;
};
@@ -91,7 +88,6 @@ public:
bool operator==(const char *p_name) const;
bool operator!=(const String &p_name) const;
_FORCE_INLINE_ bool operator<(const StringName &p_name) const {
-
return _data < p_name._data;
}
_FORCE_INLINE_ bool operator==(const StringName &p_name) const {
@@ -100,7 +96,6 @@ public:
return _data == p_name._data;
}
_FORCE_INLINE_ uint32_t hash() const {
-
if (_data)
return _data->hash;
else
@@ -112,7 +107,6 @@ public:
bool operator!=(const StringName &p_name) const;
_FORCE_INLINE_ operator String() const {
-
if (_data) {
if (_data->cname)
return String(_data->cname);
@@ -128,20 +122,16 @@ public:
static StringName search(const String &p_name);
struct AlphCompare {
-
_FORCE_INLINE_ bool operator()(const StringName &l, const StringName &r) const {
-
const char *l_cname = l._data ? l._data->cname : "";
const char *r_cname = r._data ? r._data->cname : "";
if (l_cname) {
-
if (r_cname)
return is_str_less(l_cname, r_cname);
else
return is_str_less(l_cname, r._data->name.ptr());
} else {
-
if (r_cname)
return is_str_less(l._data->name.ptr(), r_cname);
else