1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

AK: Rename Vector::append(Vector) => Vector::extend(Vector)

Let's make it a bit more clear when we're appending the elements from
one vector to the end of another vector.
This commit is contained in:
Andreas Kling 2021-06-12 13:24:45 +02:00
parent 7e1bffdeb8
commit dc65f54c06
37 changed files with 103 additions and 104 deletions

View file

@ -227,15 +227,15 @@ public:
VERIFY(did_allocate);
}
void append(Vector&& other)
void extend(Vector&& other)
{
auto did_allocate = try_append(move(other));
auto did_allocate = try_extend(move(other));
VERIFY(did_allocate);
}
void append(Vector const& other)
void extend(Vector const& other)
{
auto did_allocate = try_append(other);
auto did_allocate = try_extend(other);
VERIFY(did_allocate);
}
@ -506,7 +506,7 @@ public:
return true;
}
[[nodiscard]] bool try_append(Vector&& other)
[[nodiscard]] bool try_extend(Vector&& other)
{
if (is_empty()) {
*this = move(other);
@ -521,7 +521,7 @@ public:
return true;
}
[[nodiscard]] bool try_append(Vector const& other)
[[nodiscard]] bool try_extend(Vector const& other)
{
if (!try_grow_capacity(size() + other.size()))
return false;