Skip to content

Commit bfd242d

Browse files
authored
3.x: Remove unnecessary cancel/dispose calls from terminating using (#7121)
1 parent cdc7510 commit bfd242d

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/main/java/io/reactivex/rxjava3/core/FlowableSubscriber.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
import io.reactivex.rxjava3.annotations.NonNull;
1919

2020
/**
21-
* Represents a Reactive-Streams inspired {@link Subscriber} that is RxJava 2 only
22-
* and weakens rules §1.3 and §3.9 of the specification for gaining performance.
21+
* Represents a Reactive-Streams inspired {@link Subscriber} that is RxJava 3 only
22+
* and weakens the Reactive Streams rules <a href='https://github.com/reactive-streams/reactive-streams-jvm#1.3'>§1.3</a>
23+
* and <a href='https://github.com/reactive-streams/reactive-streams-jvm#3.9'>§3.9</a> of the specification
24+
* for gaining performance.
2325
*
2426
* <p>History: 2.0.7 - experimental; 2.1 - beta
2527
* @param <T> the value type

src/main/java/io/reactivex/rxjava3/internal/operators/flowable/FlowableUsing.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,13 @@ public void onError(Throwable t) {
117117
}
118118
}
119119

120-
upstream.cancel();
121120
if (innerError != null) {
122121
downstream.onError(new CompositeException(t, innerError));
123122
} else {
124123
downstream.onError(t);
125124
}
126125
} else {
127126
downstream.onError(t);
128-
upstream.cancel();
129127
disposeResource();
130128
}
131129
}
@@ -143,11 +141,9 @@ public void onComplete() {
143141
}
144142
}
145143

146-
upstream.cancel();
147144
downstream.onComplete();
148145
} else {
149146
downstream.onComplete();
150-
upstream.cancel();
151147
disposeResource();
152148
}
153149
}

src/main/java/io/reactivex/rxjava3/internal/operators/observable/ObservableUsing.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,9 @@ public void onError(Throwable t) {
115115
}
116116
}
117117

118-
upstream.dispose();
119118
downstream.onError(t);
120119
} else {
121120
downstream.onError(t);
122-
upstream.dispose();
123121
disposeResource();
124122
}
125123
}
@@ -137,11 +135,9 @@ public void onComplete() {
137135
}
138136
}
139137

140-
upstream.dispose();
141138
downstream.onComplete();
142139
} else {
143140
downstream.onComplete();
144-
upstream.dispose();
145141
disposeResource();
146142
}
147143
}

0 commit comments

Comments
 (0)