mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 07:19:37 +02:00
* manual CSE for fcomponents[i] in FindComponent, mantis #31628
git-svn-id: trunk@35946 -
This commit is contained in:
parent
8c200fcfba
commit
5d317a4e46
@ -543,16 +543,16 @@ end;
|
||||
Function TComponent.FindComponent(const AName: string): TComponent;
|
||||
|
||||
Var I : longint;
|
||||
|
||||
C : TComponent;
|
||||
begin
|
||||
Result:=Nil;
|
||||
If (AName='') or Not assigned(FComponents) then exit;
|
||||
For i:=0 to FComponents.Count-1 do
|
||||
if (CompareText(TComponent(FComponents[I]).Name,AName)=0) then
|
||||
begin
|
||||
Result:=TComponent(FComponents.Items[I]);
|
||||
exit;
|
||||
end;
|
||||
Begin
|
||||
c:=TComponent(FComponents[I]);
|
||||
If (CompareText(C.Name,AName)=0) then
|
||||
Exit(C);
|
||||
End;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user