* patch by cobines to improve speed of TFPList.Move, resolves #21436

git-svn-id: trunk@20606 -
This commit is contained in:
florian 2012-03-23 20:16:03 +00:00
parent 0a118768c0
commit a7fe7b5d06

View File

@ -255,9 +255,10 @@ begin
if ((NewIndex < 0) or (NewIndex > Count -1)) then
Error(SlistIndexError, NewIndex);
Temp := FList^[CurIndex];
FList^[CurIndex] := nil;
Self.Delete(CurIndex);
Self.Insert(NewIndex, nil);
if NewIndex > CurIndex then
System.Move(FList^[CurIndex+1], FList^[CurIndex], (NewIndex - CurIndex) * SizeOf(Pointer))
else
System.Move(FList^[NewIndex], FList^[NewIndex+1], (CurIndex - NewIndex) * SizeOf(Pointer));
FList^[NewIndex] := Temp;
end;