peephole optimization
This commit is contained in:
parent
d74660f7e5
commit
f252e20dfe
@ -56,8 +56,9 @@ public class BinaryHeapOpenSet implements IOpenSet {
|
|||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
PathNode result = array[1];
|
PathNode result = array[1];
|
||||||
array[1] = array[size];
|
PathNode val = array[size];
|
||||||
array[1].heapPosition = 1;
|
array[1] = val;
|
||||||
|
val.heapPosition = 1;
|
||||||
array[size] = null;
|
array[size] = null;
|
||||||
size--;
|
size--;
|
||||||
result.heapPosition = -1;
|
result.heapPosition = -1;
|
||||||
@ -66,7 +67,6 @@ public class BinaryHeapOpenSet implements IOpenSet {
|
|||||||
}
|
}
|
||||||
int index = 1;
|
int index = 1;
|
||||||
int smallerChild = 2;
|
int smallerChild = 2;
|
||||||
PathNode val = array[index];
|
|
||||||
double cost = val.combinedCost;
|
double cost = val.combinedCost;
|
||||||
do {
|
do {
|
||||||
int right = smallerChild + 1;
|
int right = smallerChild + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user