Skip to content

Commit 31281b6

Browse files
committed
Update as per review
1 parent 83fc06f commit 31281b6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/rx/internal/operators/OperatorGroupBy.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,11 @@ private void completeInner() {
399399
if (WIP_FOR_UNSUBSCRIBE_UPDATER.decrementAndGet(this) == 0) {
400400
// It means `groups.isEmpty() && child.isUnsubscribed()` is true
401401
unsubscribe();
402-
}
403-
// if we have no outstanding groups (all completed or unsubscribe) and terminated on outer
404-
if (groups.isEmpty() && terminated == TERMINATED_WITH_COMPLETED) {
402+
} else if (groups.isEmpty() && terminated == TERMINATED_WITH_COMPLETED) {
403+
// if we have no outstanding groups (all completed or unsubscribe) and terminated on outer
405404
// completionEmitted ensures we only emit onCompleted once
406405
if (COMPLETION_EMITTED_UPDATER.compareAndSet(this, 0, 1)) {
407-
if (!child.isUnsubscribed()) {
408-
child.onCompleted();
409-
}
406+
child.onCompleted();
410407
}
411408
}
412409
}

0 commit comments

Comments
 (0)