-
Notifications
You must be signed in to change notification settings - Fork 613
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
Conversation
Rather than change the Javadoc, I think we should fix the behavior. EDIT: Just saw that this was the suggestion from #1666 (comment) |
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 |
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.
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.
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.
I apologize for the oversight in my previous commit. I have now reverted these 3 primitive stg files.
Hi @mohrezaei , |
LGTM too, I'll merge it. |
For issue #1666