diff options
Diffstat (limited to 'AK')
-rw-r--r-- | AK/TypedTransfer.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/AK/TypedTransfer.h b/AK/TypedTransfer.h index 91045a9da9..64ed7fb274 100644 --- a/AK/TypedTransfer.h +++ b/AK/TypedTransfer.h @@ -37,7 +37,10 @@ public: return 0; if constexpr (Traits<T>::is_trivial()) { - __builtin_memmove(destination, source, count * sizeof(T)); + if (count == 1) + *destination = *source; + else + __builtin_memmove(destination, source, count * sizeof(T)); return count; } |