Skip to content

Refactor code by removing internal ok variable#194

Merged
phiwuu merged 2 commits into
mainfrom
internal/source-manager-remove-ok-variable
May 28, 2026
Merged

Refactor code by removing internal ok variable#194
phiwuu merged 2 commits into
mainfrom
internal/source-manager-remove-ok-variable

Conversation

@phiwuu
Copy link
Copy Markdown
Member

@phiwuu phiwuu commented May 21, 2026

Refactor method register_file:
The internal variable ok represents an internal state that tracks the control flow of the try-except block.
The variable is not needed after all, as we can directly return True or False in the appropriate control flows using early return.

This refactoring simplifies code maintenance.

@phiwuu phiwuu requested a review from a team as a code owner May 21, 2026 16:03
@phiwuu phiwuu added the internal Affects the CI, tests or refactorings only, not relevant to the end-user label May 21, 2026
@phiwuu phiwuu force-pushed the internal/source-manager-remove-ok-variable branch 2 times, most recently from 3c281ea to b5e4d3b Compare May 21, 2026 16:07
@phiwuu phiwuu enabled auto-merge (squash) May 21, 2026 16:08
Refactor method `register_file`:
The internal variable `ok` represents an internal state that tracks
the control flow of the try-except block.
The variable is not needed after all, as we can directly return
`True` or `False` in the appropriate control flows using early return.

This refactoring simplifies code maintenance.
@phiwuu phiwuu force-pushed the internal/source-manager-remove-ok-variable branch from b5e4d3b to 624d6bd Compare May 27, 2026 11:00
@phiwuu phiwuu merged commit 59d17e3 into main May 28, 2026
23 checks passed
@phiwuu phiwuu deleted the internal/source-manager-remove-ok-variable branch May 28, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Affects the CI, tests or refactorings only, not relevant to the end-user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants