diff options
Diffstat (limited to 'core/vmap.h')
-rw-r--r-- | core/vmap.h | 15 |
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); } |