Skip to content

Commit

Permalink
Replace FastList.newList(iterable) with Lists.mutable.withAll().
Browse files Browse the repository at this point in the history
  • Loading branch information
motlin committed Apr 12, 2022
1 parent 8702946 commit ce97a57
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .idea/inspectionProfiles/IDE.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Goldman Sachs.
* Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -117,7 +117,7 @@ public static <E> MutableList<E> wrapList(Iterable<E> iterable)
{
return ListAdapter.adapt((List<E>) iterable);
}
return FastList.newList(iterable);
return Lists.mutable.withAll(iterable);
}

public static <E> MutableCollection<E> adapt(Collection<E> collection)
Expand Down
Expand Up @@ -670,12 +670,12 @@ protected SubList(AbstractMutableList<T> list, int fromIndex, int toIndex)
@Override
public MutableList<T> toReversed()
{
return FastList.newList(this).reverseThis();
return Lists.mutable.withAll(this).reverseThis();
}

protected Object writeReplace()
{
return FastList.newList(this);
return Lists.mutable.withAll(this);
}

@Override
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Goldman Sachs and others.
* Copyright (c) 2022 Goldman Sachs and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v. 1.0 which accompany this distribution.
Expand Down Expand Up @@ -106,7 +106,7 @@ public MutableList<T> asSynchronized()
@Override
public MutableList<T> clone()
{
return FastList.newList(this.delegate);
return Lists.mutable.withAll(this.delegate);
}

/**
Expand Down
Expand Up @@ -54,6 +54,7 @@ public <T> MutableList<T> withInitialCapacity(int capacity)
@Override
public <T> MutableList<T> withAll(Iterable<? extends T> iterable)
{
//noinspection SSBasedInspection
return FastList.newList(iterable);
}

Expand Down
Expand Up @@ -118,7 +118,7 @@ public MutableList<T> asSynchronized()
@Override
public MutableList<T> clone()
{
return FastList.newList(this.delegate);
return Lists.mutable.withAll(this.delegate);
}

/**
Expand Down
Expand Up @@ -3195,7 +3195,7 @@ public static <T extends Comparable<? super T>> MutableList<T> toSortedList(Iter
*/
public static <T> MutableList<T> toSortedList(Iterable<T> iterable, Comparator<? super T> comparator)
{
return FastList.newList(iterable).sortThis(comparator);
return Lists.mutable.withAll(iterable).sortThis(comparator);
}

/**
Expand Down

0 comments on commit ce97a57

Please sign in to comment.