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

Fix incorrect Javadoc for SortedSetIterable.intersect(),SetIterable.intersect() . #1672

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

lzcyx
Copy link
Contributor

@lzcyx lzcyx commented Aug 18, 2024

For issue #1666

@motlin
Copy link
Contributor

motlin commented Aug 18, 2024

Rather than change the Javadoc, I think we should fix the behavior.

EDIT: Just saw that this was the suggestion from #1666 (comment)

@mohrezaei
Copy link
Member

Just as point of reference, the difference in performance can be drastic if the set sizes are very different. E.g. if one set has 1M elements and the other has 10, changing the code will make this example 100,000x slower.

@@ -61,7 +61,11 @@ public interface Immutable<name>Set extends Immutable<name>Collection, <name>Set

/**
* Returns the set of all objects that are members of both {@code this} and {@code set}. The intersection of
* [1, 2, 3] and [2, 3, 4] is the set [2, 3].
* [1, 2, 3] and [2, 3, 4] is the set [2, 3]. The output will contain instances from the smaller of the two sets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

primitives only have one sense of equality. They are value types, so there is no "memory reference" distinction. Ditto for the other 2 primitive stg files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize for the oversight in my previous commit. I have now reverted these 3 primitive stg files.

@lzcyx lzcyx changed the title Fix incorrect Javadoc for SortedSetIterable.intersect(),SetIterable.intersect() and some stg files. Fix incorrect Javadoc for SortedSetIterable.intersect(),SetIterable.intersect() . Aug 19, 2024
@lzcyx
Copy link
Contributor Author

lzcyx commented Aug 23, 2024

Hi @mohrezaei ,
I wanted to check in on this PR. I've made the requested changes and would appreciate it if you could review them when you have a chance.
Thank you for your time and guidance!

@mohrezaei
Copy link
Member

LGTM, but I was hoping to get a second opinion from @motlin or @donraab

@motlin
Copy link
Contributor

motlin commented Aug 25, 2024

LGTM too, I'll merge it.

@motlin motlin merged commit fbc8293 into eclipse:master Aug 25, 2024
18 checks passed
@eclipse eclipse deleted a comment from 0x78f1935 Sep 18, 2024
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