* patch by Bart Broersma, simplify TStringList.InsertItem, resolves #23860

git-svn-id: trunk@23638 -
This commit is contained in:
florian 2013-02-20 21:36:02 +00:00
parent d7c96dea8b
commit b00ff8a4e0

View File

@ -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;