-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Enumerable#each_cons support for accepting deque as a reuse buffer #7233
Enumerable#each_cons support for accepting deque as a reuse buffer #7233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Should |
@straight-shoota it'd break a lot of code, since a lot of code only takes arrays. |
Should I rebase it down to three commits again? |
yeah |
d098cff
to
9088392
Compare
9088392
to
901275f
Compare
938a961
to
987257f
Compare
Deques can be more performant. Quite dramatically so if each_cons is given large n:s.
Deques can be more performant. Quite dramatically so if each_cons is given large n:s.
987257f
to
1c23c29
Compare
(rebased) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @yxhuvud 👍
This removes the restriction on
Enumerable#each_cons
andIterator#cons
to only accept arrays as a container to reuse. With this, it will be possible to use a Deque instead, for better performance.Also adds some missing tests in iterator_spec.cr
Solves #7189