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

Observable.from(iterable) - ensure it.hasNext() is not called unnecessarily #3006 #3009

Merged
merged 1 commit into from
Jun 9, 2015

Conversation

davidmoten
Copy link
Collaborator

This PR is a fix for #3006.

Ensured it.hasNext() not called more often than required especially when unsubscription happens before completion.

Added two unit tests (one for fast path and the other for backpressure) that failed on previous codebase.

@akarnokd
Copy link
Member

akarnokd commented Jun 8, 2015

You forgot to implement ``remove()` which is only default in Java 8.

@davidmoten
Copy link
Collaborator Author

Ta, fixed.

@akarnokd
Copy link
Member

akarnokd commented Jun 8, 2015

Still it doesn't compile:

/home/travis/build/ReactiveX/RxJava/src/test/java/rx/internal/operators/OnSubscribeFromIterableTest.java:233: error: <anonymous rx.internal.operators.OnSubscribeFromIterableTest$4$1> is not abstract and does not override abstract method remove() in Iterator
return new Iterator() {

@davidmoten
Copy link
Collaborator Author

woops, there were two of them. Fixed.

@zsxwing
Copy link
Member

zsxwing commented Jun 9, 2015

LGTM 👍

@akarnokd
Copy link
Member

akarnokd commented Jun 9, 2015

Thanks!

akarnokd added a commit that referenced this pull request Jun 9, 2015
Observable.from(iterable) - ensure it.hasNext() is not called unnecessarily #3006
@akarnokd akarnokd merged commit f768546 into ReactiveX:1.x Jun 9, 2015
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