Skip to content

Core: Collapse redundant nested if statements - #17491

Open
uros-b wants to merge 2 commits into
apache:mainfrom
uros-b:core-collapse-nested-if-waputil
Open

Core: Collapse redundant nested if statements#17491
uros-b wants to merge 2 commits into
apache:mainfrom
uros-b:core-collapse-nested-if-waputil

Conversation

@uros-b

@uros-b uros-b commented Aug 3, 2026

Copy link
Copy Markdown
Member

Collapses nested if statements into a single condition (if (A) { if (B) {...} } -> if (A && B) {...}) in a few core classes, reducing nesting with no behavior change. In each case the outer if wrapped only the inner if (no else, nothing else in the block), and && preserves the original short-circuit evaluation.

Merges the nested if in WapUtil.validateWapPublish into a single condition to reduce nesting. Behavior-preserving (isWapIdPublished is side-effect-free and && short-circuits identically).
@github-actions github-actions Bot added the core label Aug 3, 2026
@uros-b uros-b changed the title Core: Collapse nested if in WapUtil.validateWapPublish Core: Collapse redundant nested if statements Aug 3, 2026

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for CI

@gtrettenero gtrettenero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants