* More efficient condition checks for "tnodeutils.has_init_list"

This commit is contained in:
J. Gareth "Curious Kit" Moreton 2024-09-09 22:02:47 +01:00 committed by FPK
parent 3ae64e5e17
commit a4ff1d185e

View File

@ -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;