From 9e48eb40a01f0e0889b60043f48151d3a493578d Mon Sep 17 00:00:00 2001 From: yueh Date: Sun, 2 Nov 2014 10:23:32 +0100 Subject: [PATCH] Moved getGrid() (WeakReference) to a local var --- src/main/java/appeng/me/Grid.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/appeng/me/Grid.java b/src/main/java/appeng/me/Grid.java index 9c6750b0..d3ff3958 100644 --- a/src/main/java/appeng/me/Grid.java +++ b/src/main/java/appeng/me/Grid.java @@ -105,8 +105,9 @@ public class Grid implements IGrid if ( gridNode.getGridStorage() != null ) { GridStorage gs = gridNode.getGridStorage(); + IGrid grid = gs.getGrid(); - if ( gs.getGrid() == null ) + if ( grid == null ) { myStorage = gs; myStorage.setGrid( this ); @@ -114,7 +115,7 @@ public class Grid implements IGrid for (IGridCache gc : caches.values()) gc.onJoin( myStorage ); } - else if ( gs.getGrid() != this ) + else if ( grid != this ) { if ( myStorage == null ) { @@ -127,7 +128,7 @@ public class Grid implements IGrid { gs.addDivided( myStorage ); - for (IGridCache gc : ((Grid) gs.getGrid()).caches.values()) + for (IGridCache gc : ((Grid) grid).caches.values()) gc.onSplit( tmp ); for (IGridCache gc : caches.values())