Skip to content

Conversation

Muzry
Copy link
Contributor

@Muzry Muzry commented Oct 17, 2025

What type of PR is this?

Other

What does this PR do? Why is it needed?
This PR refactors the checkpoint options validation with a switch statement instead of multiple if conditions.

if blockPath == "" && statePath == "" {
    ...
}
if blockPath != "" && statePath == "" {
    ...
}
if blockPath == "" && statePath != "" { // statePath is guaranteed to be non-empty here
    ...
}

The previous code used multiple if statements to handle the combinations of blockPath and statePath, which made the logic a bit repetitive and not very intuitive.

This change replaces them with a switch statement to enhance readability and clarify the flow.

No functional changes are introduced.

Acknowledgements

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant