mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:39:33 +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;
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user