mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-26 21:50:03 +02:00
* patch by cobines to improve speed of TFPList.Move, resolves #21436
git-svn-id: trunk@20606 -
This commit is contained in:
parent
0a118768c0
commit
a7fe7b5d06
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user