AK: Always call memmove in Span instead of memcpy.
https://github.com/SerenityOS/serenity/pull/3166#discussion_r471031704
This commit is contained in:
parent
5de131667a
commit
aef6f00195
Notes:
sideshowbarker
2024-07-19 03:32:07 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/aef6f00195f Pull-request: https://github.com/SerenityOS/serenity/pull/3179
1 changed files with 1 additions and 12 deletions
13
AK/Span.h
13
AK/Span.h
|
@ -161,23 +161,12 @@ public:
|
|||
}
|
||||
|
||||
ALWAYS_INLINE void copy_to(Span other) const
|
||||
{
|
||||
ASSERT(other.size() >= size());
|
||||
__builtin_memcpy(other.data(), data(), sizeof(T) * size());
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void copy_trimmed_to(Span other) const
|
||||
{
|
||||
__builtin_memcpy(other.data(), data(), sizeof(T) * min(size(), other.size()));
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void move_to(Span other) const
|
||||
{
|
||||
ASSERT(other.size() >= size());
|
||||
__builtin_memmove(other.data(), data(), sizeof(T) * size());
|
||||
}
|
||||
|
||||
ALWAYS_INLINE void move_trimmed_to(Span other) const
|
||||
ALWAYS_INLINE void copy_trimmed_to(Span other) const
|
||||
{
|
||||
__builtin_memmove(other.data(), data(), sizeof(T) * min(size(), other.size()));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue