diff options
Diffstat (limited to 'core/vector.h')
-rw-r--r-- | core/vector.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/vector.h b/core/vector.h index 4521b29339..696984ac28 100644 --- a/core/vector.h +++ b/core/vector.h @@ -70,8 +70,9 @@ public: void remove(int p_index) { _cowdata.remove(p_index); } void erase(const T &p_val) { int idx = find(p_val); - if (idx >= 0) + if (idx >= 0) { remove(idx); + } } void invert(); @@ -94,8 +95,9 @@ public: template <class C> void sort_custom() { int len = _cowdata.size(); - if (len == 0) + if (len == 0) { return; + } T *data = ptrw(); SortArray<T, C> sorter; @@ -168,12 +170,14 @@ void Vector<T>::invert() { template <class T> void Vector<T>::append_array(Vector<T> p_other) { const int ds = p_other.size(); - if (ds == 0) + if (ds == 0) { return; + } const int bs = size(); resize(bs + ds); - for (int i = 0; i < ds; ++i) + for (int i = 0; i < ds; ++i) { ptrw()[bs + i] = p_other[i]; + } } template <class T> |