AK: Simplify Vector::padded_capacity

We don't need to do `max(4, ...)` if the RHS always adds 4.
This commit is contained in:
Jelle Raaijmakers 2023-06-13 12:38:38 +02:00 committed by Andreas Kling
parent 521ad55a61
commit 65a9eb1fdf
Notes: sideshowbarker 2024-07-17 05:58:46 +09:00

View file

@ -819,7 +819,7 @@ private:
static size_t padded_capacity(size_t capacity)
{
return max(static_cast<size_t>(4), capacity + (capacity / 4) + 4);
return 4 + capacity + capacity / 4;
}
StorageType* slot(size_t i) { return &data()[i]; }