Calls to First on No_List intentionally return Empty node, so explicit
guards against No_List are unnecessary. Code cleanup; semantics is
unaffected.
gcc/ada/
* sem_util.adb (New_Copy_Tree): Remove redundant calls to Present.
-- Note that the element of a syntactic list is always a node, never
-- an entity or itype, hence the call to Visit_Node.
- if Present (List) then
- Elmt := First (List);
- while Present (Elmt) loop
- Visit_Node (Elmt);
+ Elmt := First (List);
+ while Present (Elmt) loop
+ Visit_Node (Elmt);
- Next (Elmt);
- end loop;
- end if;
+ Next (Elmt);
+ end loop;
end Visit_List;
----------------
-- If the node is a block, we need to process all declarations
-- in the block and make new entities for each.
- if Nkind (N) = N_Block_Statement and then Present (Declarations (N))
- then
+ if Nkind (N) = N_Block_Statement then
declare
Decl : Node_Id := First (Declarations (N));