Skip to content

2.x: cleanup based on IntelliJ 2017.1 inspections #5222

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
Mar 24, 2017

Conversation

akarnokd
Copy link
Member

This PR is the result of running IntelliJ inspections on the code:

  • replace unsubscribe with cancel and dispose in the main classes to better match the 2.x terminology
  • write out a couple of local variables
  • remove unnecessary return and continue statements
  • remove unnecessary variable writes
  • remove unnecessary and unused fields
  • add final to some fields
  • fix typos

@akarnokd akarnokd added this to the 2.0 backlog milestone Mar 24, 2017
@codecov
Copy link

codecov bot commented Mar 24, 2017

Codecov Report

Merging #5222 into 2.x will increase coverage by 0.12%.
The diff coverage is 97.29%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #5222      +/-   ##
============================================
+ Coverage     96.01%   96.13%   +0.12%     
+ Complexity     5747     5743       -4     
============================================
  Files           628      628              
  Lines         41085    41060      -25     
  Branches       5698     5692       -6     
============================================
+ Hits          39446    39473      +27     
+ Misses          657      629      -28     
+ Partials        982      958      -24
Impacted Files Coverage Δ Complexity Δ
...a/io/reactivex/internal/util/MergerBiFunction.java 92.3% <ø> (ø) 12 <0> (ø) ⬇️
...operators/observable/ObservableConcatMapEager.java 99.45% <ø> (-0.01%) 2 <0> (ø)
...vex/internal/operators/flowable/FlowableCache.java 92.61% <ø> (-1.39%) 7 <0> (ø)
...ors/observable/ObservableDistinctUntilChanged.java 100% <ø> (ø) 2 <0> (ø) ⬇️
src/main/java/io/reactivex/Flowable.java 100% <ø> (ø) 522 <0> (ø) ⬇️
...al/operators/flowable/FlowableFlattenIterable.java 97.22% <ø> (-0.02%) 4 <0> (ø)
src/main/java/io/reactivex/Observable.java 100% <ø> (ø) 506 <0> (ø) ⬇️
src/main/java/io/reactivex/Single.java 99.32% <ø> (ø) 131 <0> (ø) ⬇️
...ex/internal/operators/flowable/FlowableWindow.java 90.67% <ø> (+5.07%) 4 <0> (ø) ⬇️
src/main/java/io/reactivex/Scheduler.java 98.83% <ø> (ø) 11 <0> (ø) ⬇️
... and 83 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59dc7a3...314a695. Read the comment docs.

for (int i = 0; i < n; i++) {
JoinInnerSubscriber<T> inner = s[i];

for (JoinInnerSubscriber<T> inner : s) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might want to leave it as it was before since that way you won't allocate an iterator

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, yeah, I forget that who knows what optimization the Android VM does (the JVM's escape analysis optimizes this nicely). I'll restore the original indexed version.

@akarnokd akarnokd merged commit 0a07ac1 into ReactiveX:2.x Mar 24, 2017
@akarnokd akarnokd deleted the Cleanup324a branch March 24, 2017 18:06
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.

2 participants