Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/java/rx/internal/operators/OnSubscribeRange.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ private RangeProducer(Subscriber<? super Integer> o, int start, int end) {

@Override
public void request(long n) {
if (REQUESTED_UPDATER.get(this) == Long.MAX_VALUE) {
if (requested == Long.MAX_VALUE) {
// already started with fast-path
return;
}
if (n == Long.MAX_VALUE) {
REQUESTED_UPDATER.set(this, n);
if (n == Long.MAX_VALUE && REQUESTED_UPDATER.compareAndSet(this, 0, Long.MAX_VALUE)) {
// fast-path without backpressure
for (long i = index; i <= end; i++) {
if (o.isUnsubscribed()) {
Expand Down