Skip to content

Commit

Permalink
Remove extra roundtrips for negative offsets (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mootari authored and mourner committed Aug 8, 2019
1 parent 53c1ce4 commit 6890bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ function edt1d(grid, offset, stride, length, f, v, z) {
do {
r = v[k];
s = (f[q] - f[r] + q * q - r * r) / (q - r) / 2;
} while (s <= z[k--]);
} while (s <= z[k] && --k > -1);

k += 2;
k++;
v[k] = q;
z[k] = s;
z[k + 1] = INF;
Expand Down

0 comments on commit 6890bfb

Please sign in to comment.