diff --git a/src/main/java/rx/internal/operators/OperatorDebounceWithTime.java b/src/main/java/rx/internal/operators/OperatorDebounceWithTime.java index d8d0089441..45d3f14cd9 100644 --- a/src/main/java/rx/internal/operators/OperatorDebounceWithTime.java +++ b/src/main/java/rx/internal/operators/OperatorDebounceWithTime.java @@ -116,26 +116,22 @@ public synchronized int next(T value) { } public void emit(int index, Subscriber onNextAndComplete, Subscriber onError) { T localValue; - boolean localHasValue; synchronized (this) { if (emitting || !hasValue || index != this.index) { return; } localValue = value; - localHasValue = hasValue; value = null; hasValue = false; emitting = true; } - if (localHasValue) { - try { - onNextAndComplete.onNext(localValue); - } catch (Throwable e) { - onError.onError(e); - return; - } + try { + onNextAndComplete.onNext(localValue); + } catch (Throwable e) { + onError.onError(e); + return; } // Check if a termination was requested in the meantime.