mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-20 14:34:38 +00:00
Uint8Array is widely available (#9788)
This commit is contained in:
@ -53,9 +53,7 @@ export function closestPointOnSegment(p, p1, p2) {
|
|||||||
function _simplifyDP(points, sqTolerance) {
|
function _simplifyDP(points, sqTolerance) {
|
||||||
|
|
||||||
const len = points.length,
|
const len = points.length,
|
||||||
ArrayConstructor = typeof Uint8Array !== `${undefined}` ? Uint8Array : Array,
|
markers = new Uint8Array(len);
|
||||||
markers = new ArrayConstructor(len);
|
|
||||||
|
|
||||||
markers[0] = markers[len - 1] = 1;
|
markers[0] = markers[len - 1] = 1;
|
||||||
|
|
||||||
_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);
|
_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);
|
||||||
|
Reference in New Issue
Block a user