Lint
This commit is contained in:
@@ -27,9 +27,6 @@ class LayoutLink {
|
||||
bfs() {
|
||||
let bestByPos = new StringMap();
|
||||
|
||||
// shortcut to save the lookup
|
||||
let cheapestCostToGoal = null;
|
||||
|
||||
// BFS work queue
|
||||
let queue = new MinHeap((a) => a.cost);
|
||||
queue.push(...[
|
||||
@@ -132,7 +129,7 @@ class LayoutLink {
|
||||
} else if (taken) {
|
||||
// Traversing nodes has higher cost
|
||||
cost += 5;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Overlapping links have cost, but not if they are from or to the same
|
||||
|
||||
@@ -106,7 +106,7 @@ class LayoutNode {
|
||||
for (let i of [0, 1]) {
|
||||
vec[i] = aff.node.pos[i] - this.pos[i];
|
||||
vecsum += Math.abs(vec[i]);
|
||||
};
|
||||
}
|
||||
// Avoid calling sqrt(), since the results are used relatively
|
||||
let distanceSquared = vec[0] * vec[0] + vec[1] * vec[1];
|
||||
let weight = aff.distanceToWeight(distanceSquared, vec, aff.node.pos);
|
||||
|
||||
Reference in New Issue
Block a user