mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:47:34 +00:00
AK: Fast path for single-element TypedTransfer::copy
Co-Authored-By: Brian Gianforcaro <bgianf@serenityos.org>
This commit is contained in:
parent
d5dce448ea
commit
3891d6d73a
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue