mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:57:44 +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:
parent
7e1bffdeb8
commit
dc65f54c06
37 changed files with 103 additions and 104 deletions
12
AK/Vector.h
12
AK/Vector.h
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue