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

Always compute Enumerable#count through enumeration for 1.9+ #979

Merged
merged 1 commit into from Aug 31, 2013

Conversation

Projects
None yet
2 participants
@dmarcotte
Copy link
Contributor

commented Aug 30, 2013

Looks like MRI dropped the #size optimization in #count in 1.9.2. Comparing the 1.8 doc to the 2.0 doc also shows this is the intended behavior (interestingly, the 1.9 doc seems to be out of date)

Update to match that behavior (also fixes #922).

Don't use #size for #count in 1.9+
Starting in 1.9, #count is always computed through enumeration

headius added a commit that referenced this pull request Aug 31, 2013

Merge pull request #979 from dmarcotte/fix-count
Always compute Enumerable#count through enumeration for 1.9+

@headius headius merged commit a4f8fca into jruby:master Aug 31, 2013

1 check passed

default The Travis CI build passed
Details
@headius

This comment has been minimized.

Copy link
Member

commented Aug 31, 2013

Thanks! Do you think you'll be able to look into enumerator_with_size logic too?

@dmarcotte

This comment has been minimized.

Copy link
Contributor Author

commented Sep 1, 2013

Absolutely. Might be a couple of weeks before I can send it, but it's definitely coming.

@dmarcotte dmarcotte referenced this pull request Nov 17, 2013

Closed

Fix count_spec (1.7.x) #1231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.