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

feat(sequenceEqual): adds sequenceEqual operator #1883

Merged
merged 7 commits into from
Aug 16, 2016
Merged

feat(sequenceEqual): adds sequenceEqual operator #1883

merged 7 commits into from
Aug 16, 2016

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Aug 16, 2016

  • add necessary tests
  • documentation
  • perf tests

resolves #1882

@benlesh benlesh mentioned this pull request Aug 16, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 96.941% when pulling c239460 on blesh:sequenceEqual into a2b2f3d on ReactiveX:master.

this.destination.error(errorObject.e);
}
} else {
areEqual = a === b;
Copy link
Member

Choose a reason for hiding this comment

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

what about making subscriber's ctor provides default value of (defaultComparor) instead of line 14, then remove this branch to check comparor exists? it'll makes comparison in checkValues and _complete lot similar, may can be extracted into common function.

Copy link
Member Author

Choose a reason for hiding this comment

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

conditionals are cheaper than function calls. I originally had what you suggested, but optimized.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. please allow me one following question, per line 66 it always supplies comparor to default value, so usual consumer directly uses operator won't hit this cases unless explicitly clears it like sequenceEqual(other, null) - is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, in my most recent commit, I've removed the value checking from _complete entirely because it wasn't necessary, and also removed the defaultComparor.

Copy link
Member

Choose a reason for hiding this comment

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

ah, I can see it now. Thanks for clarification 👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 96.941% when pulling 9796456 on blesh:sequenceEqual into a2b2f3d on ReactiveX:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) to 96.941% when pulling 9796456 on blesh:sequenceEqual into a2b2f3d on ReactiveX:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 97.113% when pulling 86e2c46 on blesh:sequenceEqual into a2b2f3d on ReactiveX:master.

- adds most basic tests
- documentation still required
- more tests necessary

resolves #1882
- improves code coverage
- removes value checking and simplifies the comparison of the buffers, they should both be zero at that point
- removes defaultComparor that should not have been used
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 97.113% when pulling ec887f5 on blesh:sequenceEqual into 64ecb9e on ReactiveX:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 97.113% when pulling ec887f5 on blesh:sequenceEqual into 64ecb9e on ReactiveX:master.

@kwonoj
Copy link
Member

kwonoj commented Aug 16, 2016

Change looks good to me, :shipit:

@kwonoj kwonoj merged commit da8c1c2 into ReactiveX:master Aug 16, 2016
@benlesh benlesh deleted the sequenceEqual branch August 16, 2016 18:58
@lock
Copy link

lock bot commented Jun 6, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sequenceEqual operator
3 participants