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

2.x: Completable enhance doOnEvent to reduce allocations #4486

Merged
merged 1 commit into from
Sep 6, 2016
Merged

2.x: Completable enhance doOnEvent to reduce allocations #4486

merged 1 commit into from
Sep 6, 2016

Conversation

vanniktech
Copy link
Collaborator

No description provided.

return doOnLifecycle(Functions.emptyConsumer(), Functions.emptyConsumer(),
onComplete, Functions.EMPTY_ACTION,
Functions.EMPTY_ACTION, Functions.EMPTY_ACTION);
public final Completable doOnComplete(final Action onComplete) {
Copy link
Member

Choose a reason for hiding this comment

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

Why? There was no extra allocations here as the others are just static instances.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How is this any different from this?

Copy link
Member

Choose a reason for hiding this comment

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

Looks like that comment was misaligned. You changed SingleDoOnEvent to have 2 arguments and then had 2 allocations to work with BiConsumer.

@codecov-io
Copy link

codecov-io commented Sep 6, 2016

Current coverage is 78.19% (diff: 70.83%)

Merging #4486 into 2.x will increase coverage by <.01%

@@                2.x      #4486   diff @@
==========================================
  Files           494        495     +1   
  Lines         33661      33679    +18   
  Methods           0          0          
  Messages          0          0          
  Branches       5290       5290          
==========================================
+ Hits          26319      26335    +16   
+ Misses         5381       5377     -4   
- Partials       1961       1967     +6   

Powered by Codecov. Last update eddc153...b8ec13f

@vanniktech vanniktech changed the title 2.x: Completable enhance doOn event operators to reduce allocations 2.x: Completable enhance doOnEvent to reduce allocations Sep 6, 2016
@vanniktech
Copy link
Collaborator Author

@akarnokd this is the way it is desired now, correct?

@akarnokd
Copy link
Member

akarnokd commented Sep 6, 2016

Great! 👍

@akarnokd akarnokd merged commit b6c13f7 into ReactiveX:2.x Sep 6, 2016
@vanniktech vanniktech deleted the 2.x_enhance_completable_do_on branch September 6, 2016 15:18
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