Skip to content

1.x: merge/flatMap to keep scalar/inner element relative order #4209

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

Merged
merged 2 commits into from
Jul 20, 2016

Conversation

akarnokd
Copy link
Member

This PR changes flatmap to make sure there is no element reordering happening on the fast-paths.

Related: #4206.

@codecov-io
Copy link

codecov-io commented Jul 18, 2016

Current coverage is 84.31%

Merging #4209 into 1.x will increase coverage by 0.07%

@@                1.x      #4209   diff @@
==========================================
  Files           265        265          
  Lines         17281      17291    +10   
  Methods           0          0          
  Messages          0          0          
  Branches       2617       2619     +2   
==========================================
+ Hits          14558      14579    +21   
+ Misses         1881       1869    -12   
- Partials        842        843     +1   

Powered by Codecov. Last updated by 65c7070...95daa74

@davidmoten
Copy link
Collaborator

Thanks @akarnokd for quick fix. I haven't reviewed yet but I'm keen to see the issue resolved in a release soon (I also was suprised flatMap didn't honour individual observable order).

@@ -352,9 +352,15 @@ void tryEmit(InnerSubscriber<T> subscriber, T value) {
}
}
if (success) {
emitScalar(subscriber, value, r);
if (subscriber.queue == null || subscriber.queue.isEmpty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

assign subscriber.queue to local variable to avoid double volatile read?

@davidmoten
Copy link
Collaborator

reviewed 👍

@akarnokd
Copy link
Member Author

Updated, thanks @davidmoten !

@artem-zinnatullin
Copy link
Contributor

👍

1 similar comment
@stevegury
Copy link
Member

👍

@akarnokd akarnokd merged commit 4d5515a into ReactiveX:1.x Jul 20, 2016
@akarnokd akarnokd deleted the FlatMapStrictInnerOrder branch July 20, 2016 21:04
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.

5 participants