Landing: 9a71bf784841

Project / Subsystem

gcc / ada

Date

2025-03-20

Author

Piotr Trojanek

Commit

9a71bf784841107b93db0d2015d35fd7264fc62a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ada
patch_id
commit_hash
9a71bf784841107b93db0d2015d35fd7264fc62a
source_type
github
headline
Remove redundant guard against empty list of declarations
tldr
The Ada compiler's `Scan_Declarations` function was simplified by removing an unnecessary check for empty declaration lists.
author
Piotr Trojanek
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • ada
  • compiler
  • refactoring
  • code quality
discussion_id_link
bugzilla_pr
date
2025-03-20T00:00:00.000Z

This commit cleans up the Ada compiler’s exp_ch9.adb by removing a redundant guard in the Scan_Declarations function. The previous code included an explicit check for an empty list of declarations, which is unnecessary because the First operation on an empty list (No_List) already correctly returns Empty. This refinement improves code clarity and efficiency without affecting the compiler’s behavior.