Replace Memory::Move with std::copy

This commit is contained in:
Ted John 2018-01-31 13:08:42 +00:00
parent 7851446a6f
commit bb8b6a3f68
3 changed files with 2 additions and 13 deletions

View File

@ -102,17 +102,6 @@ namespace Memory
return (T*)memcpy((void*)dst, (const void*)src, size);
}
template<typename T>
static T * Move(T * dst, const T * src, size_t size)
{
if (size == 0) return (T*)dst;
Guard::ArgumentNotNull(dst, "Trying to move memory to nullptr");
Guard::ArgumentNotNull(src, "Trying to move memory from nullptr");
T* result =(T*)memmove((void*)dst, (const void*)src, size);
Guard::ArgumentNotNull(result, "Failed to move %u bytes of memory from %x to %x for %s", size, src, dst, typeid(T).name());
return result;
}
template<typename T>
static T * Duplicate(const T * src, size_t size)
{

View File

@ -484,7 +484,7 @@ namespace String
Guard::Assert(newStringSize < currentStringSize, GUARD_LINE);
#endif
Memory::Move(str, firstNonWhitespace, newStringSize);
std::memmove(str, firstNonWhitespace, newStringSize);
str[newStringSize] = '\0';
}
else

View File

@ -925,7 +925,7 @@ static void vehicle_update_sound_params(rct_vehicle * vehicle)
// Shift all sound params down one if using a free space
if (soundParam != gVehicleSoundParamsListEnd)
{
Memory::Move<rct_vehicle_sound_params>(
std::memmove(
soundParam + 1,
soundParam,
((gVehicleSoundParamsListEnd - soundParam) - 1) * sizeof(rct_vehicle_sound_params));