diff options
-rw-r--r-- | AK/Vector.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/AK/Vector.h b/AK/Vector.h index f13fb1198a..743d7b6a88 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -746,6 +746,12 @@ public: return {}; } + void reverse() + { + for (size_t i = 0; i < size() / 2; ++i) + AK::swap(at(i), at(size() - i - 1)); + } + private: void reset_capacity() { |