mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use mem_copy
instead of for
-loop in CPacker::AddRaw
Using `memcpy` is faster, assuming the compiler doesn't already transform the loop to `memcpy` automatically.
This commit is contained in:
parent
35f071b021
commit
51e3c37c03
|
@ -72,12 +72,8 @@ void CPacker::AddRaw(const void *pData, int Size)
|
|||
return;
|
||||
}
|
||||
|
||||
const unsigned char *pSrc = (const unsigned char *)pData;
|
||||
while(Size)
|
||||
{
|
||||
*m_pCurrent++ = *pSrc++;
|
||||
Size--;
|
||||
}
|
||||
mem_copy(m_pCurrent, pData, Size);
|
||||
m_pCurrent += Size;
|
||||
}
|
||||
|
||||
void CUnpacker::Reset(const void *pData, int Size)
|
||||
|
|
Loading…
Reference in a new issue