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:
Robert Müller 2023-11-21 21:49:29 +01:00
parent 35f071b021
commit 51e3c37c03

View file

@ -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)