mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
memmove instead of memcpy
This commit is contained in:
parent
9466e81590
commit
f978d748fa
1 changed files with 3 additions and 3 deletions
|
@ -423,10 +423,10 @@ int insertIntoSortedArrays(void* value, float key, int originalIndex,
|
|||
// i is our desired location
|
||||
// shift array elements to the right
|
||||
if (i < currentCount && i+1 < maxCount) {
|
||||
memcpy(&valueArray[i + 1], &valueArray[i], sizeof(void*) * (currentCount - i));
|
||||
memcpy(&keyArray[i + 1], &keyArray[i], sizeof(float) * (currentCount - i));
|
||||
memmove(&valueArray[i + 1], &valueArray[i], sizeof(void*) * (currentCount - i));
|
||||
memmove(&keyArray[i + 1], &keyArray[i], sizeof(float) * (currentCount - i));
|
||||
if (originalIndexArray) {
|
||||
memcpy(&originalIndexArray[i + 1], &originalIndexArray[i], sizeof(int) * (currentCount - i));
|
||||
memmove(&originalIndexArray[i + 1], &originalIndexArray[i], sizeof(int) * (currentCount - i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue