Skip to content

Commit dea5af5

Browse files
Simplify Subscription Chain
1 parent c3b5353 commit dea5af5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

rxjava-core/src/main/java/rx/operators/OperatorAll.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,8 @@
1515
*/
1616
package rx.operators;
1717

18-
import java.util.concurrent.atomic.AtomicBoolean;
19-
20-
import rx.Observable;
21-
import rx.Observable.OnSubscribeFunc;
2218
import rx.Observable.Operator;
23-
import rx.Observer;
2419
import rx.Subscriber;
25-
import rx.Subscription;
2620
import rx.functions.Func1;
2721

2822
/**
@@ -40,8 +34,9 @@ public OperatorAll(Func1<? super T, Boolean> predicate) {
4034

4135
@Override
4236
public Subscriber<? super T> call(final Subscriber<? super Boolean> child) {
43-
Subscriber s = new Subscriber<T>() {
37+
return new Subscriber<T>(child) {
4438
boolean done;
39+
4540
@Override
4641
public void onNext(T t) {
4742
boolean result = predicate.call(t);
@@ -67,7 +62,5 @@ public void onCompleted() {
6762
}
6863
}
6964
};
70-
child.add(s);
71-
return s;
7265
}
7366
}

0 commit comments

Comments
 (0)