Skip to content

Commit 29b5150

Browse files
committed
Change to a single 'get' call
1 parent 0979f84 commit 29b5150

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rxjava-core/src/main/java/rx/operators/OperatorAmb.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,11 @@ public void onError(Throwable e) {
158158
}
159159

160160
private boolean isSelected() {
161-
if (choice.get() == NONE) {
161+
int ch = choice.get();
162+
if (ch == NONE) {
162163
return choice.compareAndSet(NONE, index);
163164
}
164-
return choice.get() == index;
165+
return ch == index;
165166
}
166167
}
167168

0 commit comments

Comments
 (0)