-
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
1.x: distinctUntilChanged with direct value comparator - alternative #4034
1.x: distinctUntilChanged with direct value comparator - alternative #4034
Conversation
return; | ||
} | ||
|
||
if (!comparison) { |
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.
There's a subtle NPE potential here. Not sure if you want to explicitly guard against it from a misbehaving comparator
implementation.
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.
Good catch! I'll change the comparison to be primitive boolean to trigger NPE inside the try-block if necessary.
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.
Done.
lgtm 👍 |
Thanks Jake for the review! |
👍 |
Alternative implementation to #4001.