* Reverse IndexOf. Increases speed of freeing collection with a factor N^2

git-svn-id: trunk@19268 -
This commit is contained in:
michael 2011-09-28 17:44:32 +00:00
parent 448e3db450
commit 39d8ee1136

View File

@ -198,9 +198,9 @@ end;
function TFPList.IndexOf(Item: Pointer): Integer;
begin
Result := 0;
while(Result < FCount) and (Flist^[Result] <> Item) do Result := Result + 1;
If Result = FCount then Result := -1;
Result:=Count-1;
while (Result >=0) and (Flist^[Result]<>Item) do
Result:=Result - 1;
end;
procedure TFPList.Insert(Index: Integer; Item: Pointer);