Skip to content

Commit 0866090

Browse files
zbennett10mourner
authored andcommitted
moved queue instantiation to avoid unnecessary declaration (mapbox#47)
1 parent a1741c0 commit 0866090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

polylabel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ function polylabel(polygon, precision, debug) {
2323
var cellSize = Math.min(width, height);
2424
var h = cellSize / 2;
2525

26+
if (cellSize === 0) return [minX, minY];
27+
2628
// a priority queue of cells in order of their "potential" (max distance to polygon)
2729
var cellQueue = new Queue(null, compareMax);
2830

29-
if (cellSize === 0) return [minX, minY];
30-
3131
// cover polygon with initial cells
3232
for (var x = minX; x < maxX; x += cellSize) {
3333
for (var y = minY; y < maxY; y += cellSize) {

0 commit comments

Comments
 (0)