Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify show_source's super calculation #807

Merged
merged 1 commit into from Dec 10, 2023
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Dec 9, 2023

We can simplify show_source command's -s flag handling by removing the possibility to have it nil.

I'm also working on a more sophisticated flag parsing mechanism for all commands. And this change will help simplify that solution too.

@st0012 st0012 self-assigned this Dec 9, 2023

if source
show_source(source)
elsif s_count
elsif super_level
Copy link
Member

Choose a reason for hiding this comment

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

I think comparing with 0 is missing. super_level is changed to be always a number.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch 👍
I also added a test case for it.

@tompng tompng merged commit 2cccc44 into master Dec 10, 2023
47 checks passed
@tompng tompng deleted the refactor-show_source branch December 10, 2023 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants