diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2021-03-14 07:21:32 +0000 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2021-03-21 10:20:08 +0000 |
commit | 755c70b871c659df2d7c3a003593f38775dd7b5d (patch) | |
tree | 9196b3da289e7ffc27e321ce6c4d2f97e0af7c95 /core/templates | |
parent | 07f076fa4f2896415993bb8e3fb42128423de0d2 (diff) |
Rename Array.invert() to Array.reverse()
Does the same internally for List and Vector<>, which includes all
PackedArray types.
Diffstat (limited to 'core/templates')
-rw-r--r-- | core/templates/list.h | 2 | ||||
-rw-r--r-- | core/templates/vector.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/templates/list.h b/core/templates/list.h index eaf1dbb4a0..010e35eed8 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -492,7 +492,7 @@ public: _data->last = p_I; } - void invert() { + void reverse() { int s = size() / 2; Element *F = front(); Element *B = back(); diff --git a/core/templates/vector.h b/core/templates/vector.h index 6a8902707c..a56a941dbc 100644 --- a/core/templates/vector.h +++ b/core/templates/vector.h @@ -74,7 +74,7 @@ public: remove(idx); } } - void invert(); + void reverse(); _FORCE_INLINE_ T *ptrw() { return _cowdata.ptrw(); } _FORCE_INLINE_ const T *ptr() const { return _cowdata.ptr(); } @@ -194,7 +194,7 @@ public: }; template <class T> -void Vector<T>::invert() { +void Vector<T>::reverse() { for (int i = 0; i < size() / 2; i++) { T *p = ptrw(); SWAP(p[i], p[size() - i - 1]); |