mapbox / polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)
Other
1.44k stars 151 forks source link

Move queue instantiation after return condition #35

Closed DaniBarca closed 6 years ago

DaniBarca commented 6 years ago

I suggest moving this line after the "if( cellSize === 0 ) return;". Won't make a big difference in most cases but I think it's a good practice not to create an instance that could never be used.

https://github.com/mapbox/polylabel/blob/51f09d04c21e7b7faf94e2300ca1fe6e1f12fa7f/polylabel.js#L27