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

Enumerator::Lazy#take should switch size with Infinity #3425

Merged
merged 2 commits into from
Jun 5, 2015

Conversation

kachick
Copy link
Member

@kachick kachick commented Jun 5, 2015

No description provided.

@@ -258,7 +258,7 @@ def take(n)
raise ArgumentError, "attempt to take negative size" if n < 0

current_size = enumerator_size
set_size = if current_size.kind_of?(Integer)
set_size = if current_size.kind_of?(Numeric)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I understand this change, is current_size a Float in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, Infinity(Float::INFINITY) is a Float.

loop.size.class #=> Float

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yeah, now it makes sense.

yorickpeterse pushed a commit that referenced this pull request Jun 5, 2015
Enumerator::Lazy#take should switch size with Infinity
@yorickpeterse yorickpeterse merged commit c575a16 into rubinius:master Jun 5, 2015
@yorickpeterse
Copy link
Contributor

Thanks!

@kachick
Copy link
Member Author

kachick commented Jun 5, 2015

Thanks to merge!

@kachick kachick deleted the fix-lazy-take-size branch June 5, 2015 17:39
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