Replaced LinkedList with ArrayList or ArrayDeque when applicable. (#3392)

This commit is contained in:
yueh
2018-05-27 21:15:50 +02:00
committed by GitHub
parent 62435a65f1
commit d7b97fa7b8
37 changed files with 118 additions and 117 deletions
+4 -5
View File
@@ -25,7 +25,6 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
import java.util.WeakHashMap;
@@ -1134,7 +1133,7 @@ public class Platform
public static <T extends IAEStack<T>> T poweredExtraction( final IEnergySource energy, final IMEInventory<T> cell, final T request, final IActionSource src )
{
final T possible = cell.extractItems( (T) request.copy(), Actionable.SIMULATE, src );
final T possible = cell.extractItems( request.copy(), Actionable.SIMULATE, src );
long retrieved = 0;
if( possible != null )
@@ -1166,7 +1165,7 @@ public class Platform
public static <T extends IAEStack<T>> T poweredInsert( final IEnergySource energy, final IMEInventory<T> cell, final T input, final IActionSource src )
{
final T possible = cell.injectItems( (T) input.copy(), Actionable.SIMULATE, src );
final T possible = cell.injectItems( input.copy(), Actionable.SIMULATE, src );
long stored = input.getStackSize();
if( possible != null )
@@ -1185,7 +1184,7 @@ public class Platform
if( itemToAdd < input.getStackSize() )
{
final long original = input.getStackSize();
final T split = (T) input.copy();
final T split = input.copy();
split.decStackSize( itemToAdd );
input.setStackSize( itemToAdd );
split.add( cell.injectItems( input, Actionable.MODULATE, src ) );
@@ -1266,7 +1265,7 @@ public class Platform
public static <T extends IAEStack<T>> void postListChanges( final IItemList<T> before, final IItemList<T> after, final IMEMonitorHandlerReceiver<T> meMonitorPassthrough, final IActionSource source )
{
final LinkedList<T> changes = new LinkedList<>();
final List<T> changes = new ArrayList<>();
for( final T is : before )
{