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/ustring.h | |
| 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/ustring.h')
| -rw-r--r-- | core/ustring.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/core/ustring.h b/core/ustring.h index 34f9c18bad..5b13a1c704 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -51,8 +51,9 @@ class CharProxy { public: _FORCE_INLINE_ operator T() const { - if (unlikely(_index == _cowdata.size())) + if (unlikely(_index == _cowdata.size())) { return _null; + } return _cowdata.get(_index); } @@ -83,8 +84,9 @@ public: _FORCE_INLINE_ char get(int p_index) const { return _cowdata.get(p_index); } _FORCE_INLINE_ void set(int p_index, const char &p_elem) { _cowdata.set(p_index, p_elem); } _FORCE_INLINE_ const char &operator[](int p_index) const { - if (unlikely(p_index == _cowdata.size())) + if (unlikely(p_index == _cowdata.size())) { return _null; + } return _cowdata.get(p_index); } @@ -151,8 +153,9 @@ public: Error resize(int p_size) { return _cowdata.resize(p_size); } _FORCE_INLINE_ const CharType &operator[](int p_index) const { - if (unlikely(p_index == _cowdata.size())) + if (unlikely(p_index == _cowdata.size())) { return _null; + } return _cowdata.get(p_index); } @@ -388,16 +391,17 @@ struct NaturalNoCaseComparator { template <typename L, typename R> _FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) { while (true) { - if (*l_ptr == 0 && *r_ptr == 0) + if (*l_ptr == 0 && *r_ptr == 0) { return false; - else if (*l_ptr == 0) + } else if (*l_ptr == 0) { return true; - else if (*r_ptr == 0) + } else if (*r_ptr == 0) { return false; - else if (*l_ptr < *r_ptr) + } else if (*l_ptr < *r_ptr) { return true; - else if (*l_ptr > *r_ptr) + } else if (*l_ptr > *r_ptr) { return false; + } l_ptr++; r_ptr++; |
