Skip to content

RubyArray: Fix intersect? for small arrays#7905

Merged
enebo merged 1 commit intojruby:masterfrom
skmp:master
Aug 28, 2023
Merged

RubyArray: Fix intersect? for small arrays#7905
enebo merged 1 commit intojruby:masterfrom
skmp:master

Conversation

@skmp
Copy link
Contributor

@skmp skmp commented Aug 26, 2023

Following the mainline ruby code, intersect? is supposed to test by Eql, not by Equal.

For the small-array optimisation of this, includes_p was used, instead of includesByEql, which gave wrong results.

Issue: #7852 , though this should really also have a unit test somewhere.

@ahorek
Copy link
Contributor

ahorek commented Aug 26, 2023

nice! There's already a unit test and it's passing with your change. Could you remove the tag? https://github.com/jruby/jruby/blob/master/spec/tags/ruby/core/array/intersect_tags.txt#L1

@skmp
Copy link
Contributor Author

skmp commented Aug 27, 2023

Amended the commit, and hopefully now all tests pass.

Not very familiar with the code base, was just looking for a bug to solve last night :)

@ahorek should I remove the tag file entirely (like I did) or just leave it empty? Looked around a bit in the source code didn't see any empty ones.

@ahorek ahorek added this to the JRuby 9.4.4.0 milestone Aug 27, 2023
@ahorek
Copy link
Contributor

ahorek commented Aug 27, 2023

if there's only a single tag, you can remove the whole file. Thanks

@enebo enebo merged commit 69cfd1b into jruby:master Aug 28, 2023
@enebo
Copy link
Member

enebo commented Aug 28, 2023

@skmp Thanks for the PR!

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.

3 participants