| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Block-receiving Range#count should always use Enumerable logic. Also add single-arg form which falls back on Enumerable. Fixes jruby#8955
These specs are lightly-modified versions of the same specs from Enumerable#count, but those specs depend on the Enumerable having multiple of the same value. A shared spec could probably be pulled out. See jruby#8955.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Logic installed to prevent large ranges from manually iterating to calculate a count (79ee920) short-circuited the fallback on Enumerable#count logic. That broke count when passed a block (as described in #8955). Additionally, we did not handle the case where Range#count is passed an argument.
This PR fixes both cases and adds specs.