Skip to content

Commit 538547b

Browse files
Subscriptions cleanup
- make createSubscription be create … as I had originally intended to do but forgot to - make EmptySubscription a singleton
1 parent ff0b767 commit 538547b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rxjava-core/src/main/java/rx/subscriptions/Subscriptions.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public class Subscriptions {
1212
* @return {@link Subscription}
1313
*/
1414
public static Subscription empty() {
15-
return new EmptySubscription();
15+
return EMPTY;
1616
}
1717

1818
/**
1919
* A {@link Subscription} implemented via a Func
2020
*
2121
* @return {@link Subscription}
2222
*/
23-
public static Subscription createSubscription(final Action0 unsubscribe) {
23+
public static Subscription create(final Action0 unsubscribe) {
2424
return new Subscription() {
2525

2626
@Override
@@ -36,7 +36,7 @@ public void unsubscribe() {
3636
*
3737
* @return {@link Subscription}
3838
*/
39-
public static Subscription createSubscription(final Object unsubscribe) {
39+
public static Subscription create(final Object unsubscribe) {
4040
final FuncN<?> f = Functions.from(unsubscribe);
4141
return new Subscription() {
4242

@@ -51,8 +51,8 @@ public void unsubscribe() {
5151
/**
5252
* A {@link Subscription} that does nothing when its unsubscribe method is called.
5353
*/
54-
private static class EmptySubscription implements Subscription {
54+
private static Subscription EMPTY = new Subscription() {
5555
public void unsubscribe() {
5656
}
57-
}
57+
};
5858
}

0 commit comments

Comments
 (0)