Skip to content

Commit 56983e6

Browse files
committed
OperatorScan should check for MAX_VALUE on request
1 parent f10fe76 commit 56983e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rxjava-core/src/main/java/rx/internal/operators/OperatorScan.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public void setProducer(final Producer producer) {
129129
@Override
130130
public void request(long n) {
131131
if (once.compareAndSet(false, true)) {
132-
if (initialValue == NO_INITIAL_VALUE) {
132+
if (initialValue == NO_INITIAL_VALUE || n == Long.MAX_VALUE) {
133133
producer.request(n);
134134
} else {
135135
producer.request(n - 1);

0 commit comments

Comments
 (0)