AK: Add Vector::take(index)

This removes an item from the vector and returns it.
This commit is contained in:
Andreas Kling 2019-11-07 20:38:24 +01:00
parent d6f9349f15
commit 870be9d71e

View file

@ -263,6 +263,13 @@ public:
return value;
}
T take(int index)
{
T value = move(at(index));
remove(index);
return value;
}
void remove(int index)
{
ASSERT(index < m_size);