Skip to content

Commit

Permalink
improve perf on certain kinds of input
Browse files Browse the repository at this point in the history
e.g. 1.5x faster for points on a grid, and orders of magnitude faster on degenerate input. Thanks @fogleman!
  • Loading branch information
mourner committed Aug 30, 2018
1 parent 70ce33c commit 3a61ecc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export default class Delaunator {
key = (key + 1) % this._hashSize;
} while ((!start || start.removed) && key !== startKey);

start = start.prev;
e = start;
while (area(x, y, e.x, e.y, e.next.x, e.next.y) >= 0) {
e = e.next;
Expand Down
Loading

0 comments on commit 3a61ecc

Please sign in to comment.