mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
LibC: Upgrade memmove() to memcpy() when possible
We were missing out on opportunities to use memcpy() instead of memmove() when the source and destination don't overlap.
This commit is contained in:
parent
af8732435c
commit
5b19e9239a
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ void* memset(void* dest_ptr, int c, size_t n)
|
|||
|
||||
void* memmove(void* dest, const void* src, size_t n)
|
||||
{
|
||||
if (dest < src)
|
||||
if (((FlatPtr)dest - (FlatPtr)src) >= n)
|
||||
return memcpy(dest, src, n);
|
||||
|
||||
u8* pd = (u8*)dest;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue