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

(method.arity + args.size == 0) ??? #56

Closed
tagliala opened this issue Feb 27, 2024 · 0 comments · Fixed by #57
Closed

(method.arity + args.size == 0) ??? #56

tagliala opened this issue Feb 27, 2024 · 0 comments · Fixed by #57

Comments

@tagliala
Copy link
Member

tagliala commented Feb 27, 2024

Because of operator precedence, this is the same as (method.arity + args.size) == 0, but it is confusing

elsif method.arity < 0 && (method.arity + args.size == 0) && args.last.is_a?(Hash)

@tagliala tagliala changed the title method.arity + args.size == 0 ??? (method.arity + args.size == 0) ??? Feb 27, 2024
tagliala added a commit that referenced this issue Feb 27, 2024
tagliala added a commit that referenced this issue Feb 27, 2024
Refine method argument check for clarity: Both
`(method.arity + args.size == 0)` and `(method.arity + args.size) == 0`
are equivalent due to operator precedence, but the latter is preferred
for improved readability.

Close #56
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 a pull request may close this issue.

1 participant