Skip to content

Commit

Permalink
Optimize two-basis test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jun 1, 2017
1 parent b3f92a5 commit d4ffc60
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/pack/enclose.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function extendBasis(B, p) {

// If we get here then B must have at least one element.
for (i = 0; i < B.length; ++i) {
if (isBasis2(B[i], p) && enclosesAll(encloseBasis2(B[i], p), B)) {
if (!encloses(p, B[i]) && enclosesAll(encloseBasis2(B[i], p), B)) {
return [B[i], p];
}
}
Expand Down Expand Up @@ -112,11 +112,6 @@ function encloseBasis3(a, b, c) {
};
}

function isBasis2(a, b) {
return !encloses(a, b)
&& !encloses(b, a);
}

function isBasis3(a, b, c) {
return !encloses(encloseBasis2(a, b), c)
&& !encloses(encloseBasis2(a, c), b)
Expand Down

0 comments on commit d4ffc60

Please sign in to comment.