refactor: Simplify SpanPopBack

Use the equivalent back() and first() member functions.
This commit is contained in:
MarcoFalke 2024-12-17 22:45:26 +01:00
parent facc4f120b
commit faae6fa5f6
No known key found for this signature in database

View file

@ -248,9 +248,8 @@ template <typename T>
T& SpanPopBack(Span<T>& span)
{
size_t size = span.size();
ASSERT_IF_DEBUG(size > 0);
T& back = span[size - 1];
span = Span<T>(span.data(), size - 1);
T& back = span.back();
span = span.first(size - 1);
return back;
}