1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 22:29:55 +00:00

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

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]; }