Skip to content

Commit 2672b74

Browse files
committed
Call complete on take/takeWhile observables once the predicate is true.
1 parent d172fd9 commit 2672b74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public void onNext(T args) {
147147
if (predicate.call(args, counter.getAndIncrement())) {
148148
observer.onNext(args);
149149
} else {
150+
observer.onCompleted();
150151
// this will work if the sequence is asynchronous, it will have no effect on a synchronous observable
151152
subscription.unsubscribe();
152153
}

0 commit comments

Comments
 (0)