diff --git a/AK/TypedTransfer.h b/AK/TypedTransfer.h index 91045a9da95..64ed7fb2748 100644 --- a/AK/TypedTransfer.h +++ b/AK/TypedTransfer.h @@ -37,7 +37,10 @@ public: return 0; if constexpr (Traits::is_trivial()) { - __builtin_memmove(destination, source, count * sizeof(T)); + if (count == 1) + *destination = *source; + else + __builtin_memmove(destination, source, count * sizeof(T)); return count; }