summaryrefslogtreecommitdiffstats
path: root/core/vmap.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-14 16:41:43 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-14 21:57:34 +0200
commit0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (patch)
tree198d4ff7665d89307f6ca2469fa38620a9eb1672 /core/vmap.h
parent07bc4e2f96f8f47991339654ff4ab16acc19d44f (diff)
downloadredot-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/vmap.h')
-rw-r--r--core/vmap.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/vmap.h b/core/vmap.h
index 358b6260a4..c91ea9b3c9 100644
--- a/core/vmap.h
+++ b/core/vmap.h
@@ -54,8 +54,9 @@ private:
_FORCE_INLINE_ int _find(const T &p_val, bool &r_exact) const {
r_exact = false;
- if (_cowdata.empty())
+ if (_cowdata.empty()) {
return 0;
+ }
int low = 0;
int high = _cowdata.size() - 1;
@@ -63,8 +64,9 @@ private:
int middle = 0;
#ifdef DEBUG_ENABLED
- if (low > high)
+ if (low > high) {
ERR_PRINT("low > high, this may be a bug");
+ }
#endif
while (low <= high) {
middle = (low + high) / 2;
@@ -80,14 +82,16 @@ private:
}
//return the position where this would be inserted
- if (a[middle].key < p_val)
+ if (a[middle].key < p_val) {
middle++;
+ }
return middle;
}
_FORCE_INLINE_ int _find_exact(const T &p_val) const {
- if (_cowdata.empty())
+ if (_cowdata.empty()) {
return -1;
+ }
int low = 0;
int high = _cowdata.size() - 1;
@@ -127,8 +131,9 @@ public:
void erase(const T &p_val) {
int pos = _find_exact(p_val);
- if (pos < 0)
+ if (pos < 0) {
return;
+ }
_cowdata.remove(pos);
}