diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:41:43 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 21:57:34 +0200 |
commit | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch) | |
tree | 198d4ff7665d89307f6ca2469fa38620a9eb1672 /core/compressed_translation.cpp | |
parent | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff) | |
download | redot-engine-0ee0fa42e6639b6fa474b7cf6afc6b1a78142185.tar.gz |
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
Diffstat (limited to 'core/compressed_translation.cpp')
-rw-r--r-- | core/compressed_translation.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index dd46e23505..a66997aa52 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -109,8 +109,9 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) { const Vector<Pair<int, CharString>> &b = buckets[i]; Map<uint32_t, int> &t = table.write[i]; - if (b.size() == 0) + if (b.size() == 0) { continue; + } int d = 1; int item = 0; @@ -189,22 +190,24 @@ bool PHashTranslation::_set(const StringName &p_name, const Variant &p_value) { strings = p_value; } else if (name == "load_from") { generate(p_value); - } else + } else { return false; + } return true; } bool PHashTranslation::_get(const StringName &p_name, Variant &r_ret) const { String name = p_name.operator String(); - if (name == "hash_table") + if (name == "hash_table") { r_ret = hash_table; - else if (name == "bucket_table") + } else if (name == "bucket_table") { r_ret = bucket_table; - else if (name == "strings") + } else if (name == "strings") { r_ret = strings; - else + } else { return false; + } return true; } @@ -212,8 +215,9 @@ bool PHashTranslation::_get(const StringName &p_name, Variant &r_ret) const { StringName PHashTranslation::get_message(const StringName &p_src_text) const { int htsize = hash_table.size(); - if (htsize == 0) + if (htsize == 0) { return StringName(); + } CharString str = p_src_text.operator String().utf8(); uint32_t h = hash(0, str.get_data()); |