From aef6f00195f01b1235218d2426b64524cb6fe89d Mon Sep 17 00:00:00 2001 From: asynts Date: Sun, 16 Aug 2020 19:12:56 +0200 Subject: [PATCH] AK: Always call memmove in Span instead of memcpy. https://github.com/SerenityOS/serenity/pull/3166#discussion_r471031704 --- AK/Span.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/AK/Span.h b/AK/Span.h index a4daf5c4ad..ec62904313 100644 --- a/AK/Span.h +++ b/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())); }