Skip to content

Commit 35f2807

Browse files
committed
SerialSubscription and MultipleAssignmentSubscription should use Subscriptions.empty()
1 parent 4c16adf commit 35f2807

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/main/java/rx/subscriptions/MultipleAssignmentSubscription.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
* if unsubscribed.
2626
*/
2727
public final class MultipleAssignmentSubscription implements Subscription {
28-
/** The shared empty state. */
29-
static final State EMPTY_STATE = new State(false, Subscriptions.unsubscribed());
30-
volatile State state = EMPTY_STATE;
28+
29+
volatile State state = new State(false, Subscriptions.empty());
3130
static final AtomicReferenceFieldUpdater<MultipleAssignmentSubscription, State> STATE_UPDATER
3231
= AtomicReferenceFieldUpdater.newUpdater(MultipleAssignmentSubscription.class, State.class, "state");
3332

src/main/java/rx/subscriptions/SerialSubscription.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
* the previous underlying subscription to be unsubscribed.
2525
*/
2626
public final class SerialSubscription implements Subscription {
27-
static final State EMPTY_STATE = new State(false, Subscriptions.unsubscribed());
28-
volatile State state = EMPTY_STATE;
27+
volatile State state = new State(false, Subscriptions.empty());
2928
static final AtomicReferenceFieldUpdater<SerialSubscription, State> STATE_UPDATER
3029
= AtomicReferenceFieldUpdater.newUpdater(SerialSubscription.class, State.class, "state");
3130

0 commit comments

Comments
 (0)