mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03: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
@ -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 New Issue
Block a user