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

1.x: distinctUntilChanged with direct value comparator - alternative #4034

Merged
merged 3 commits into from
Jun 20, 2016

Conversation

akarnokd
Copy link
Member

Alternative implementation to #4001.

return;
}

if (!comparison) {
Copy link
Contributor

@JakeWharton JakeWharton Jun 19, 2016

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@JakeWharton
Copy link
Contributor

lgtm 👍

@akarnokd
Copy link
Member Author

Thanks Jake for the review!

@stevegury
Copy link
Member

👍

@akarnokd akarnokd merged commit 6bef4ce into ReactiveX:1.x Jun 20, 2016
@akarnokd akarnokd deleted the DistinctUntilChangedComparator branch June 20, 2016 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants