* Remove using reverse search, speed up free

git-svn-id: trunk@19280 -
This commit is contained in:
michael 2011-09-29 07:59:10 +00:00
parent 4a8914cbb0
commit d766e671a9

View File

@ -215,9 +215,15 @@ end;
procedure TCollection.RemoveItem(Item: TCollectionItem);
Var
I : Integer;
begin
Notify(Item,cnExtracting);
FItems.Remove(Pointer(Item));
Notify(Item,cnExtracting);
I:=FItems.IndexOfItem(Item,fromEnd);
If (I<>-1) then
FItems.Delete(I);
Item.FCollection:=Nil;
Changed;
end;