File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/main/java/rx/subscriptions Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -85,26 +85,24 @@ public void add(final Subscription s) {
85
85
* the collection of {@link Subscription} to add
86
86
*/
87
87
public void addAll (final Subscription ... subscriptions ) {
88
- List <Subscription > subscriptionList = new ArrayList <Subscription >(4 );
89
- for (Subscription s : subscriptions ) {
90
- if (!s .isUnsubscribed ()) {
91
- subscriptionList .add (s );
92
- }
93
- }
94
-
95
88
if (!unsubscribed ) {
96
89
synchronized (this ) {
97
90
if (!unsubscribed ) {
98
91
if (this .subscriptions == null ) {
99
92
this .subscriptions = new HashSet <Subscription >(4 );
100
93
}
101
- this .subscriptions .addAll (subscriptionList );
94
+
95
+ for (Subscription s : subscriptions ) {
96
+ if (!s .isUnsubscribed ()) {
97
+ this .subscriptions .add (s );
98
+ }
99
+ }
102
100
return ;
103
101
}
104
102
}
105
103
}
106
104
107
- for (Subscription s : subscriptionList ) {
105
+ for (Subscription s : subscriptions ) {
108
106
s .unsubscribe ();
109
107
}
110
108
}
You can’t perform that action at this time.
0 commit comments