mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +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:
parent
521ad55a61
commit
65a9eb1fdf
Notes:
sideshowbarker
2024-07-17 05:58:46 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/65a9eb1fdf Pull-request: https://github.com/SerenityOS/serenity/pull/19376
1 changed files with 1 additions and 1 deletions
|
@ -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]; }
|
||||
|
|
Loading…
Reference in a new issue