GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Observable.from(iterable) - ensure it.hasNext() is not called unnecessarily #3006 by davidmoten · Pull Request #3009 · ReactiveX/RxJava

Conversation

@davidmoten

@davidmoten davidmoten commented Jun 8, 2015

Copy link
Copy Markdown
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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akarnokd akarnokd added the Enhancement label Jun 8, 2015
@akarnokd

akarnokd commented Jun 8, 2015

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidmoten
davidmoten force-pushed the from-iter-bug branch from dfa1db1 to 4f3fa5b Compare June 8, 2015 10:43
@davidmoten

davidmoten commented Jun 8, 2015

Copy link
Copy Markdown
Collaborator Author

Ta, fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akarnokd

akarnokd commented Jun 8, 2015

Copy link
Copy Markdown
Member

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() {

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@davidmoten
ensure iterator.hasNext is not called unnecessarily as per ReactiveX#…
9fa9cea
…3006
@davidmoten
davidmoten force-pushed the from-iter-bug branch from 4f3fa5b to 9fa9cea Compare June 8, 2015 19:48
@davidmoten

davidmoten commented Jun 8, 2015

Copy link
Copy Markdown
Collaborator Author

woops, there were two of them. Fixed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@zsxwing

zsxwing commented Jun 9, 2015

Copy link
Copy Markdown
Member

LGTM 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akarnokd

akarnokd commented Jun 9, 2015

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

akarnokd added a commit that referenced this pull request Jun 9, 2015
@akarnokd
Merge pull request #3009 from davidmoten/from-iter-bug
f768546
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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@davidmoten @akarnokd @zsxwing
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.