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

Fixed return value for Rubinius::Mirror::Range#step_float_iterations_… #3448

Merged

Conversation

nirvdrum
Copy link
Contributor

…size.

@@ -17,6 +17,8 @@ def step_float_iterations_size(first, last, step_size)
else
iterations = ((last - first) / step_size + err).floor + 1
end

iterations
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't the return value of the if excl block above already return this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the if modifier is false, the result of the expression is nil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively, this could be pushed inside the if block. The issue only affects the excl case.

yorickpeterse pushed a commit that referenced this pull request Jun 22, 2015
Fixed return value for Rubinius::Mirror::Range#step_float_iterations_…
@yorickpeterse yorickpeterse merged commit 2ceaa67 into rubinius:master Jun 22, 2015
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.

None yet

2 participants