mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 15:10:25 +02:00
* patch by Bart Broersma, simplify TStringList.InsertItem, resolves #23860
git-svn-id: trunk@23638 -
This commit is contained in:
parent
d7c96dea8b
commit
b00ff8a4e0
@ -1017,16 +1017,7 @@ end;
|
||||
|
||||
Procedure TStringList.InsertItem(Index: Integer; const S: string);
|
||||
begin
|
||||
Changing;
|
||||
If FCount=Fcapacity then Grow;
|
||||
If Index<FCount then
|
||||
System.Move (FList^[Index],FList^[Index+1],
|
||||
(FCount-Index)*SizeOf(TStringItem));
|
||||
Pointer(Flist^[Index].Fstring):=Nil; // Needed to initialize...
|
||||
Flist^[Index].FString:=S;
|
||||
Flist^[Index].Fobject:=Nil;
|
||||
Inc(FCount);
|
||||
Changed;
|
||||
InsertItem(Index, S, nil);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user