Skip to content

Commit e77602d

Browse files
committed
1 parent 73ab179 commit e77602d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

core/src/main/java/com/graphhopper/storage/BaseGraph.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
import com.graphhopper.search.NameIndex;
2828
import com.graphhopper.util.*;
2929
import com.graphhopper.util.shapes.BBox;
30-
31-
import static com.graphhopper.util.Helper.nf;
32-
3330
import org.slf4j.Logger;
3431
import org.slf4j.LoggerFactory;
3532

33+
import static com.graphhopper.util.Helper.nf;
34+
3635
/**
3736
* The base graph handles nodes and edges file format. It can be used with different Directory
3837
* implementations like RAMDirectory for fast access or via MMapDirectory for virtual-memory and not
@@ -703,12 +702,12 @@ void inPlaceNodeRemove(int removeNodeCount) {
703702
setWayGeometry_(fetchWayGeometry_(edgePointer, true, 0, -1, -1), edgePointer, false);
704703
}
705704

706-
// clear N_EDGE_REF
707-
initNodeRefs((nodeCount - removeNodeCount) * nodeEntryBytes, nodeCount * nodeEntryBytes);
708-
709705
if (removeNodeCount >= nodeCount)
710706
throw new IllegalStateException("graph is empty after in-place removal but was " + removeNodeCount);
711707

708+
// clear N_EDGE_REF
709+
initNodeRefs(((long) nodeCount - removeNodeCount) * nodeEntryBytes, (long) nodeCount * nodeEntryBytes);
710+
712711
// we do not remove the invalid edges => edgeCount stays the same!
713712
nodeCount -= removeNodeCount;
714713

0 commit comments

Comments
 (0)