diff options
Diffstat (limited to 'core/vset.h')
-rw-r--r-- | core/vset.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/core/vset.h b/core/vset.h index 45516bdb05..034b8fe851 100644 --- a/core/vset.h +++ b/core/vset.h @@ -40,8 +40,9 @@ class VSet { _FORCE_INLINE_ int _find(const T &p_val, bool &r_exact) const { r_exact = false; - if (_data.empty()) + if (_data.empty()) { return 0; + } int low = 0; int high = _data.size() - 1; @@ -49,8 +50,9 @@ class VSet { 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) { @@ -67,14 +69,16 @@ class VSet { } //return the position where this would be inserted - if (a[middle] < p_val) + if (a[middle] < p_val) { middle++; + } return middle; } _FORCE_INLINE_ int _find_exact(const T &p_val) const { - if (_data.empty()) + if (_data.empty()) { return -1; + } int low = 0; int high = _data.size() - 1; @@ -100,8 +104,9 @@ public: void insert(const T &p_val) { bool exact; int pos = _find(p_val, exact); - if (exact) + if (exact) { return; + } _data.insert(pos, p_val); } @@ -111,8 +116,9 @@ public: void erase(const T &p_val) { int pos = _find_exact(p_val); - if (pos < 0) + if (pos < 0) { return; + } _data.remove(pos); } |