mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #7520 from Robyt3/Packer-Improvements
Minor improvements to `CPacker` and `CUnpacker`
This commit is contained in:
commit
f95b0f163f
|
@ -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)
|
||||
|
@ -134,7 +130,8 @@ int CUnpacker::GetUncompressedInt()
|
|||
return 0;
|
||||
}
|
||||
|
||||
int i = *(int *)m_pCurrent;
|
||||
int i;
|
||||
mem_copy(&i, m_pCurrent, sizeof(int));
|
||||
m_pCurrent += sizeof(int);
|
||||
return i;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue