* manual CSE for fcomponents[i] in FindComponent, mantis #31628

git-svn-id: trunk@35946 -
This commit is contained in:
marco 2017-04-25 11:34:25 +00:00
parent 8c200fcfba
commit 5d317a4e46

View File

@ -543,16 +543,16 @@ end;
Function TComponent.FindComponent(const AName: string): TComponent; Function TComponent.FindComponent(const AName: string): TComponent;
Var I : longint; Var I : longint;
C : TComponent;
begin begin
Result:=Nil; Result:=Nil;
If (AName='') or Not assigned(FComponents) then exit; If (AName='') or Not assigned(FComponents) then exit;
For i:=0 to FComponents.Count-1 do For i:=0 to FComponents.Count-1 do
if (CompareText(TComponent(FComponents[I]).Name,AName)=0) then Begin
begin c:=TComponent(FComponents[I]);
Result:=TComponent(FComponents.Items[I]); If (CompareText(C.Name,AName)=0) then
exit; Exit(C);
end; End;
end; end;