Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
adjust code style and regenerate dist
Browse files Browse the repository at this point in the history
  • Loading branch information
andriiheonia committed Oct 24, 2020
1 parent 827fc41 commit 41fad19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions dist/hull.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ Grid.prototype = {

for (let x = tlCellX; x <= brCellX; x++) {
for (let y = tlCellY; y <= brCellY; y++) {
Array.prototype.push.apply(points, this.cellPoints(x, y));
// replaced Array.prototype.push.apply to avoid hitting stack size limit on larger arrays.
for (let i = 0; i < this.cellPoints(x, y).length; i++) {
points.push(this.cellPoints(x, y)[i]);
}
}
}

Expand All @@ -113,7 +116,7 @@ Grid.prototype = {
const cellY = this.coordToCellNum(point[1]);
const cell = this._cells[cellX][cellY];
let pointIdxInCell;

for (let i = 0; i < cell.length; i++) {
if (cell[i][0] === point[0] && cell[i][1] === point[1]) {
pointIdxInCell = i;
Expand Down
5 changes: 2 additions & 3 deletions src/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ Grid.prototype = {

for (let x = tlCellX; x <= brCellX; x++) {
for (let y = tlCellY; y <= brCellY; y++) {

// replaced Array.prototype.push.apply to avoid hitting stack size limit on larger arrays.
for(let i = 0; i < this.cellPoints(x, y).length; i++){
for (let i = 0; i < this.cellPoints(x, y).length; i++) {
points.push(this.cellPoints(x, y)[i]);
}
}
Expand All @@ -49,7 +48,7 @@ Grid.prototype = {
const cellY = this.coordToCellNum(point[1]);
const cell = this._cells[cellX][cellY];
let pointIdxInCell;

for (let i = 0; i < cell.length; i++) {
if (cell[i][0] === point[0] && cell[i][1] === point[1]) {
pointIdxInCell = i;
Expand Down

0 comments on commit 41fad19

Please sign in to comment.