[Ada] Simplify redundant checks for non-empty lists

Pierre-Marie de Rodat derodat@adacore.com
Thu Jul 8 13:50:24 GMT 2021


Simplify "Present (L) and then not Is_Empty_List (L)" into "not
Is_Empty_List (L)", since Is_Empty_List can be called on No_List
and returns True.

Code cleanup; semantics is unaffected.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_ch12.adb, sem_ch6.adb, sem_ch9.adb, sprint.adb: Simplify
	checks for non-empty lists.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2398 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210708/f82f4dcd/attachment.bin>


More information about the Gcc-patches mailing list