Skip to content

Commit c28a1c7

Browse files
committed
Remove unnecessary localHasValue check
Due to !hasValue check localHasValue field is always true
1 parent 0005db1 commit c28a1c7

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,22 @@ public synchronized int next(T value) {
116116
}
117117
public void emit(int index, Subscriber<T> onNextAndComplete, Subscriber<?> onError) {
118118
T localValue;
119-
boolean localHasValue;
120119
synchronized (this) {
121120
if (emitting || !hasValue || index != this.index) {
122121
return;
123122
}
124123
localValue = value;
125-
localHasValue = hasValue;
126124

127125
value = null;
128126
hasValue = false;
129127
emitting = true;
130128
}
131129

132-
if (localHasValue) {
133-
try {
134-
onNextAndComplete.onNext(localValue);
135-
} catch (Throwable e) {
136-
onError.onError(e);
137-
return;
138-
}
130+
try {
131+
onNextAndComplete.onNext(localValue);
132+
} catch (Throwable e) {
133+
onError.onError(e);
134+
return;
139135
}
140136

141137
// Check if a termination was requested in the meantime.

0 commit comments

Comments
 (0)