mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 20:55:35 +03: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
Notes:
sideshowbarker
2024-07-17 22:40:31 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/3891d6d73af Pull-request: https://github.com/SerenityOS/serenity/pull/11285 Reviewed-by: https://github.com/bgianfo
@ -37,6 +37,9 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if constexpr (Traits<T>::is_trivial()) {
|
if constexpr (Traits<T>::is_trivial()) {
|
||||||
|
if (count == 1)
|
||||||
|
*destination = *source;
|
||||||
|
else
|
||||||
__builtin_memmove(destination, source, count * sizeof(T));
|
__builtin_memmove(destination, source, count * sizeof(T));
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user