Replaced LinkedList with ArrayList or ArrayDeque when applicable. (#3392)
This commit is contained in:
+3
-3
@@ -19,10 +19,10 @@
|
||||
package appeng.me.cache;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -215,7 +215,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
{
|
||||
this.storageNetworks.clear();
|
||||
|
||||
final List<ICellProvider> ll = new LinkedList<ICellProvider>();
|
||||
final List<ICellProvider> ll = new ArrayList<ICellProvider>();
|
||||
ll.addAll( this.inactiveCellProviders );
|
||||
ll.addAll( this.activeCellProviders );
|
||||
|
||||
@@ -331,7 +331,7 @@ public class GridStorageCache implements IStorageGrid
|
||||
private class CellChangeTracker<T extends IAEStack<T>>
|
||||
{
|
||||
|
||||
final List<CellChangeTrackerRecord<T>> data = new LinkedList<>();
|
||||
final List<CellChangeTrackerRecord<T>> data = new ArrayList<>();
|
||||
|
||||
public void postChanges( final IStorageChannel<T> channel, final int i, final IMEInventoryHandler<T> h, final IActionSource actionSrc )
|
||||
{
|
||||
|
||||
+3
-3
@@ -19,10 +19,10 @@
|
||||
package appeng.me.cache;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -63,7 +63,7 @@ import appeng.tile.networking.TileController;
|
||||
public class PathGridCache implements IPathingGrid
|
||||
{
|
||||
|
||||
private final LinkedList<PathSegment> active = new LinkedList<>();
|
||||
private final List<PathSegment> active = new ArrayList<>();
|
||||
private final Set<TileController> controllers = new HashSet<>();
|
||||
private final Set<IGridNode> requireChannels = new HashSet<>();
|
||||
private final Set<IGridNode> blockDense = new HashSet<>();
|
||||
@@ -154,7 +154,7 @@ public class PathGridCache implements IPathingGrid
|
||||
final GridConnection gc = (GridConnection) gcc;
|
||||
if( !( gc.getOtherSide( node ).getMachine() instanceof TileController ) )
|
||||
{
|
||||
final List<IPathItem> open = new LinkedList<>();
|
||||
final List<IPathItem> open = new ArrayList<>();
|
||||
closedList.add( gc );
|
||||
open.add( gc );
|
||||
gc.setControllerRoute( (GridNode) node, true );
|
||||
|
||||
+3
-3
@@ -19,8 +19,8 @@
|
||||
package appeng.me.cache;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
@@ -47,7 +47,7 @@ public class SpatialPylonCache implements ISpatialCache
|
||||
private DimensionalCoord captureMin;
|
||||
private DimensionalCoord captureMax;
|
||||
private boolean isValid = false;
|
||||
private List<TileSpatialIOPort> ioPorts = new LinkedList<>();
|
||||
private List<TileSpatialIOPort> ioPorts = new ArrayList<>();
|
||||
private HashMap<SpatialPylonCluster, SpatialPylonCluster> clusters = new HashMap<>();
|
||||
|
||||
public SpatialPylonCache( final IGrid g )
|
||||
@@ -65,7 +65,7 @@ public class SpatialPylonCache implements ISpatialCache
|
||||
{
|
||||
|
||||
this.clusters = new HashMap<>();
|
||||
this.ioPorts = new LinkedList<>();
|
||||
this.ioPorts = new ArrayList<>();
|
||||
|
||||
for( final IGridNode gm : grid.getMachines( TileSpatialIOPort.class ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user