Use slightly faster ArrayDeqeue instead of LinkedList. Check boolean fields before more complex datatypes
This commit is contained in:
@@ -320,7 +320,7 @@ public class GridNode implements IGridNode, IPathItem
|
||||
{
|
||||
final IPathingGrid pg = g.getCache( IPathingGrid.class );
|
||||
final IEnergyGrid eg = g.getCache( IEnergyGrid.class );
|
||||
return this.meetsChannelRequirements() && eg.isNetworkPowered() && !pg.isNetworkBooting();
|
||||
return eg.isNetworkPowered() && !pg.isNetworkBooting() && this.meetsChannelRequirements();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Queues;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -49,7 +49,7 @@ import appeng.me.storage.ItemWatcher;
|
||||
public class NetworkMonitor<T extends IAEStack<T>> implements IMEMonitor<T>
|
||||
{
|
||||
@Nonnull
|
||||
private static final Deque<NetworkMonitor<?>> GLOBAL_DEPTH = Lists.newLinkedList();
|
||||
private static final Deque<NetworkMonitor<?>> GLOBAL_DEPTH = Queues.newArrayDeque();
|
||||
|
||||
@Nonnull
|
||||
private final GridStorageCache myGridCache;
|
||||
|
||||
+1
-1
@@ -402,7 +402,7 @@ public class PathGridCache implements IPathingGrid
|
||||
@Override
|
||||
public boolean isNetworkBooting()
|
||||
{
|
||||
return !this.active.isEmpty() && !this.booting;
|
||||
return !this.booting && !this.active.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
package appeng.me.storage;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NavigableMap;
|
||||
import java.util.concurrent.ConcurrentSkipListMap;
|
||||
@@ -144,7 +145,7 @@ public class MEMonitorIInventory implements IMEMonitor<IAEItemStack>, ITickingMo
|
||||
public TickRateModulation onTick()
|
||||
{
|
||||
|
||||
final LinkedList<IAEItemStack> changes = new LinkedList<>();
|
||||
final List<IAEItemStack> changes = new ArrayList<>();
|
||||
|
||||
this.list.resetStatus();
|
||||
int high = 0;
|
||||
|
||||
Reference in New Issue
Block a user