From 45d0eaf5de974fb89d5132679cc34d10d92dbdca Mon Sep 17 00:00:00 2001 From: akarnokd Date: Fri, 25 Apr 2014 10:03:41 +0200 Subject: [PATCH] Removed localTerminate as it is never observed as true at that point. --- .../main/java/rx/operators/OperatorDebounceWithTime.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rxjava-core/src/main/java/rx/operators/OperatorDebounceWithTime.java b/rxjava-core/src/main/java/rx/operators/OperatorDebounceWithTime.java index a67f480a3c..b1b5b6f9e9 100644 --- a/rxjava-core/src/main/java/rx/operators/OperatorDebounceWithTime.java +++ b/rxjava-core/src/main/java/rx/operators/OperatorDebounceWithTime.java @@ -111,14 +111,12 @@ public synchronized int next(T value) { public void emit(int index, Subscriber 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; @@ -133,11 +131,8 @@ public void emit(int index, Subscriber onNextAndComplete, Subscriber onErr return; } } - if (localTerminate) { - onNextAndComplete.onCompleted(); - return; - } + // Check if a termination was requested in the meantime. synchronized (this) { if (!terminate) { emitting = false;