mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 20:39:43 +02:00
* More efficient condition checks for "tnodeutils.has_init_list"
This commit is contained in:
parent
3ae64e5e17
commit
a4ff1d185e
@ -1235,18 +1235,23 @@ implementation
|
||||
var
|
||||
hp : tused_unit;
|
||||
begin
|
||||
Result:=false;
|
||||
Result := True;
|
||||
|
||||
{ Check current module first }
|
||||
if mf_init in current_module.moduleflags then
|
||||
Exit;
|
||||
|
||||
{ Check used units }
|
||||
hp:=tused_unit(usedunits.first);
|
||||
while assigned(hp) and (Result=false) do
|
||||
while assigned(hp) do
|
||||
begin
|
||||
if mf_init in hp.u.moduleflags then
|
||||
Result:=true;
|
||||
Exit;
|
||||
hp:=tused_unit(hp.next);
|
||||
end;
|
||||
|
||||
{ Check current module }
|
||||
Result:=Result or (mf_init in current_module.moduleflags);
|
||||
{ We reach this point, none of the used units have an initialisation list }
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user