Skip to content

Commit

Permalink
Removed localTerminate as it is never observed as true at that point.
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Apr 25, 2014
1 parent d726e5c commit 45d0eaf
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ public synchronized int next(T value) {
public void emit(int index, Subscriber<T> onNextAndComplete, Subscriber<?> onError) {
T localValue;
boolean localHasValue;
boolean localTerminate;
synchronized (this) {
if (emitting || !hasValue || index != this.index) {
return;
}
localValue = value;
localHasValue = hasValue;
localTerminate = terminate;

value = null;
hasValue = false;
Expand All @@ -133,11 +131,8 @@ public void emit(int index, Subscriber<T> onNextAndComplete, Subscriber<?> onErr
return;
}
}
if (localTerminate) {
onNextAndComplete.onCompleted();
return;
}

// Check if a termination was requested in the meantime.
synchronized (this) {
if (!terminate) {
emitting = false;
Expand Down

0 comments on commit 45d0eaf

Please sign in to comment.