Skip to content

Commit

Permalink
Update as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Dec 16, 2014
1 parent 83fc06f commit 31281b6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main/java/rx/internal/operators/OperatorGroupBy.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,11 @@ private void completeInner() {
if (WIP_FOR_UNSUBSCRIBE_UPDATER.decrementAndGet(this) == 0) {
// It means `groups.isEmpty() && child.isUnsubscribed()` is true
unsubscribe();
}
// if we have no outstanding groups (all completed or unsubscribe) and terminated on outer
if (groups.isEmpty() && terminated == TERMINATED_WITH_COMPLETED) {
} else if (groups.isEmpty() && terminated == TERMINATED_WITH_COMPLETED) {
// if we have no outstanding groups (all completed or unsubscribe) and terminated on outer
// completionEmitted ensures we only emit onCompleted once
if (COMPLETION_EMITTED_UPDATER.compareAndSet(this, 0, 1)) {
if (!child.isUnsubscribed()) {
child.onCompleted();
}
child.onCompleted();
}
}
}
Expand Down

0 comments on commit 31281b6

Please sign in to comment.