|
|
@@ -110,22 +110,7 @@ unsigned MemoryBuffer::Write(const void* data, unsigned size)
|
|
|
unsigned char* destPtr = &buffer_[position_];
|
|
|
position_ += size;
|
|
|
|
|
|
- unsigned copySize = size;
|
|
|
- while (copySize >= sizeof(unsigned))
|
|
|
- {
|
|
|
- *((unsigned*)destPtr) = *((unsigned*)srcPtr);
|
|
|
- srcPtr += sizeof(unsigned);
|
|
|
- destPtr += sizeof(unsigned);
|
|
|
- copySize -= sizeof(unsigned);
|
|
|
- }
|
|
|
- if (copySize & sizeof(unsigned short))
|
|
|
- {
|
|
|
- *((unsigned short*)destPtr) = *((unsigned short*)srcPtr);
|
|
|
- srcPtr += sizeof(unsigned short);
|
|
|
- destPtr += sizeof(unsigned short);
|
|
|
- }
|
|
|
- if (copySize & 1u)
|
|
|
- *destPtr = *srcPtr;
|
|
|
+ memcpy(destPtr, srcPtr, size);
|
|
|
|
|
|
return size;
|
|
|
}
|