mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 17:00: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,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…
Reference in New Issue
Block a user