-
Notifications
You must be signed in to change notification settings - Fork 7.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
2.x: Detail distinct() & distinctUntilChanged() in JavaDoc #5837
2.x: Detail distinct() & distinctUntilChanged() in JavaDoc #5837
Conversation
254ae70
to
4d043b2
Compare
Codecov Report
@@ Coverage Diff @@
## 2.x #5837 +/- ##
===========================================
+ Coverage 96.39% 96.4% +<.01%
- Complexity 5813 5817 +4
===========================================
Files 634 634
Lines 41760 41760
Branches 5796 5796
===========================================
+ Hits 40256 40257 +1
+ Misses 583 578 -5
- Partials 921 925 +4
Continue to review full report at Codecov.
|
* It is recommended the elements' class {@code T} in the flow overrides the default {@code Object.equals()} to provide | ||
* meaningful comparison between items as the default Java implementation only considers reference equivalence. | ||
* <p> | ||
* By default, {@code distinct()} uses an internal, per Subscriber {@link java.util.HashSet} to remember |
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.
supernit: could be phrased like that By default, {@code distinct()} uses an internal {@link java.util.HashSet} per Subscriber to remember
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.
Same below
* <p> | ||
* <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinct.png" alt=""> | ||
* <p> | ||
* It is recommended the elements' class {@code T} in the flow overrides the default {@code Object.equals()} to provide |
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.
Since we use HashSet
internally, we should probably recommend properly overriding hasCode()
as well
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.
Same below
The PR clarifies the comparison and retention behavior of the
distinct
anddistinctUntilChanged
operators (in bothFlowable
andObservable
).