Removed unnecessary synchronization
This commit is contained in:
@@ -30,7 +30,7 @@ public class PowerGraph{
|
|||||||
return graphID;
|
return graphID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void update(){
|
public void update(){
|
||||||
if(threads.getFrameID() == lastFrameUpdated || consumers.size == 0 || producers.size == 0){
|
if(threads.getFrameID() == lastFrameUpdated || consumers.size == 0 || producers.size == 0){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -62,13 +62,13 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void add(PowerGraph graph){
|
public void add(PowerGraph graph){
|
||||||
for(Tile tile : graph.all){
|
for(Tile tile : graph.all){
|
||||||
add(tile);
|
add(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void add(Tile tile){
|
public void add(Tile tile){
|
||||||
tile.entity.power.graph = this;
|
tile.entity.power.graph = this;
|
||||||
all.add(tile);
|
all.add(tile);
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void clear(){
|
public void clear(){
|
||||||
for(Tile other : all){
|
for(Tile other : all){
|
||||||
other.entity.power.graph = null;
|
other.entity.power.graph = null;
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ public class PowerGraph{
|
|||||||
consumers.clear();
|
consumers.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void reflow(Tile tile){
|
public void reflow(Tile tile){
|
||||||
queue.clear();
|
queue.clear();
|
||||||
queue.addLast(tile);
|
queue.addLast(tile);
|
||||||
closedSet.clear();
|
closedSet.clear();
|
||||||
@@ -107,7 +107,7 @@ public class PowerGraph{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void remove(Tile tile){
|
public void remove(Tile tile){
|
||||||
clear();
|
clear();
|
||||||
closedSet.clear();
|
closedSet.clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user