Skip to content

Don't call size on the input to Set.new#14990

Open
tenderlove wants to merge 1 commit intoruby:masterfrom
tenderlove:no-size-call
Open

Don't call size on the input to Set.new#14990
tenderlove wants to merge 1 commit intoruby:masterfrom
tenderlove:no-size-call

Conversation

@tenderlove
Copy link
Copy Markdown
Member

Calling size can cause side effects that we previously didn't have. In this patch, we test end on Ranges to see if they are infinite, but we simply iterate over other inputs.

ref: https://bugs.ruby-lang.org/issues/21654

[Bug #21654]

Calling `size` can cause side effects that we previously didn't have. In
this patch, we test `end` on Ranges to see if they are infinite, but we
simply iterate over other inputs.

ref: https://bugs.ruby-lang.org/issues/21654

[Bug #21654]
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.

4 participants