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.
This commit is contained in:
Rémi Verschelde 2020-05-14 13:23:58 +02:00
parent 710b34b702
commit 0be6d925dc
1552 changed files with 1 additions and 33876 deletions

View file

@ -42,7 +42,6 @@ StaticCString StaticCString::create(const char *p_ptr) {
StringName::_Data *StringName::_table[STRING_TABLE_LEN];
StringName _scs_create(const char *p_chr) {
return (p_chr[0] ? StringName(StaticCString::create(p_chr)) : StringName());
}
@ -50,24 +49,19 @@ bool StringName::configured = false;
Mutex StringName::mutex;
void StringName::setup() {
ERR_FAIL_COND(configured);
for (int i = 0; i < STRING_TABLE_LEN; i++) {
_table[i] = nullptr;
}
configured = true;
}
void StringName::cleanup() {
MutexLock lock(mutex);
int lost_strings = 0;
for (int i = 0; i < STRING_TABLE_LEN; i++) {
while (_table[i]) {
_Data *d = _table[i];
lost_strings++;
if (OS::get_singleton()->is_stdout_verbose()) {
@ -88,11 +82,9 @@ void StringName::cleanup() {
}
void StringName::unref() {
ERR_FAIL_COND(!configured);
if (_data && _data->refcount.unref()) {
MutexLock lock(mutex);
if (_data->prev) {
@ -114,9 +106,7 @@ void StringName::unref() {
}
bool StringName::operator==(const String &p_name) const {
if (!_data) {
return (p_name.length() == 0);
}
@ -124,9 +114,7 @@ bool StringName::operator==(const String &p_name) const {
}
bool StringName::operator==(const char *p_name) const {
if (!_data) {
return (p_name[0] == 0);
}
@ -134,32 +122,27 @@ bool StringName::operator==(const char *p_name) const {
}
bool StringName::operator!=(const String &p_name) const {
return !(operator==(p_name));
}
bool StringName::operator!=(const StringName &p_name) const {
// the real magic of all this mess happens here.
// this is why path comparisons are very fast
return _data != p_name._data;
}
void StringName::operator=(const StringName &p_name) {
if (this == &p_name)
return;
unref();
if (p_name._data && p_name._data->refcount.ref()) {
_data = p_name._data;
}
}
StringName::StringName(const StringName &p_name) {
_data = nullptr;
ERR_FAIL_COND(!configured);
@ -170,7 +153,6 @@ StringName::StringName(const StringName &p_name) {
}
StringName::StringName(const char *p_name) {
_data = nullptr;
ERR_FAIL_COND(!configured);
@ -187,7 +169,6 @@ StringName::StringName(const char *p_name) {
_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && _data->get_name() == p_name)
break;
@ -215,7 +196,6 @@ StringName::StringName(const char *p_name) {
}
StringName::StringName(const StaticCString &p_static_string) {
_data = nullptr;
ERR_FAIL_COND(!configured);
@ -231,7 +211,6 @@ StringName::StringName(const StaticCString &p_static_string) {
_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && _data->get_name() == p_static_string.ptr)
break;
@ -259,7 +238,6 @@ StringName::StringName(const StaticCString &p_static_string) {
}
StringName::StringName(const String &p_name) {
_data = nullptr;
ERR_FAIL_COND(!configured);
@ -275,7 +253,6 @@ StringName::StringName(const String &p_name) {
_data = _table[idx];
while (_data) {
if (_data->hash == hash && _data->get_name() == p_name)
break;
_data = _data->next;
@ -302,7 +279,6 @@ StringName::StringName(const String &p_name) {
}
StringName StringName::search(const char *p_name) {
ERR_FAIL_COND_V(!configured, StringName());
ERR_FAIL_COND_V(!p_name, StringName());
@ -317,7 +293,6 @@ StringName StringName::search(const char *p_name) {
_Data *_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && _data->get_name() == p_name)
break;
@ -332,7 +307,6 @@ StringName StringName::search(const char *p_name) {
}
StringName StringName::search(const CharType *p_name) {
ERR_FAIL_COND_V(!configured, StringName());
ERR_FAIL_COND_V(!p_name, StringName());
@ -348,7 +322,6 @@ StringName StringName::search(const CharType *p_name) {
_Data *_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && _data->get_name() == p_name)
break;
@ -362,7 +335,6 @@ StringName StringName::search(const CharType *p_name) {
return StringName(); //does not exist
}
StringName StringName::search(const String &p_name) {
ERR_FAIL_COND_V(p_name == "", StringName());
MutexLock lock(mutex);
@ -374,7 +346,6 @@ StringName StringName::search(const String &p_name) {
_Data *_data = _table[idx];
while (_data) {
// compare hash first
if (_data->hash == hash && p_name == _data->get_name())
break;