crucial performance optimization

This commit is contained in:
Leijurv 2018-12-18 16:22:54 -08:00
parent a0ab2a8ba7
commit 807d6a0cf4
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -59,7 +59,7 @@ public final class BinaryHeapOpenSet implements IOpenSet {
@Override
public final void insert(PathNode value) {
if (size >= array.length - 1) {
array = Arrays.copyOf(array, array.length * 2);
array = Arrays.copyOf(array, array.length << 1);
}
size++;
value.heapPosition = size;