Skip to content

Commit 3f03935

Browse files
Merge pull request #1208 from mttkay/tolist-uses-linked-list-buffer
OperatorToObservableList: use LinkedList to buffer the sequence’s items
2 parents 5984e95 + 0896f70 commit 3f03935

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
*/
1616
package rx.operators;
1717

18-
import java.util.ArrayList;
19-
import java.util.List;
20-
2118
import rx.Observable.Operator;
2219
import rx.Subscriber;
2320

21+
import java.util.ArrayList;
22+
import java.util.LinkedList;
23+
import java.util.List;
24+
2425
/**
2526
* Returns an Observable that emits a single item, a list composed of all the items emitted by the
2627
* source Observable.
@@ -41,7 +42,7 @@ public final class OperatorToObservableList<T> implements Operator<List<T>, T> {
4142
public Subscriber<? super T> call(final Subscriber<? super List<T>> o) {
4243
return new Subscriber<T>(o) {
4344

44-
final List<T> list = new ArrayList<T>();
45+
final List<T> list = new LinkedList<T>();
4546

4647
@Override
4748
public void onCompleted() {

0 commit comments

Comments
 (0)