diff --git a/src/kits/support/List.cpp b/src/kits/support/List.cpp index f64eb9a0b1..e61c5e1625 100644 --- a/src/kits/support/List.cpp +++ b/src/kits/support/List.cpp @@ -285,17 +285,17 @@ BList::MoveItem(int32 fromIndex, int32 toIndex) || (toIndex < 0)) return false; + void * tmpMover = fObjectList[fromIndex]; if (fromIndex < toIndex) { - void * tmpMover = fObjectList[fromIndex]; - memmove(fObjectList + fromIndex + 1, fObjectList + fromIndex, + memmove(fObjectList + fromIndex, fObjectList + fromIndex + 1, (toIndex - fromIndex) * sizeof(void *)); fObjectList[toIndex] = tmpMover; } else if (fromIndex > toIndex) { - void * tmpMover = fObjectList[fromIndex]; memmove(fObjectList + toIndex + 1, fObjectList + toIndex, (fromIndex - toIndex) * sizeof(void *)); - fObjectList[toIndex] = tmpMover; }; + fObjectList[toIndex] = tmpMover; + return true; }