mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 09:37:44 +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;
|
return 0;
|
||||||
|
|
||||||
if constexpr (Traits<T>::is_trivial()) {
|
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;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue