Skip to content

Commit 07542e1

Browse files
Simplify Subscription Chain
1 parent 50cef72 commit 07542e1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public OperatorAny(Func1<? super T, Boolean> predicate, boolean returnOnEmpty) {
3636

3737
@Override
3838
public Subscriber<? super T> call(final Subscriber<? super Boolean> child) {
39-
Subscriber<T> s = new Subscriber<T>() {
39+
return new Subscriber<T>(child) {
4040
boolean hasElements;
4141
boolean done;
4242
@Override
@@ -70,7 +70,5 @@ public void onCompleted() {
7070
}
7171

7272
};
73-
child.add(s);
74-
return s;
7573
}
7674
}

0 commit comments

Comments
 (0)