From 4825222b09d7c8845d4910692017afd5eb9d9154 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Fri, 26 May 2017 17:14:14 +0200 Subject: [PATCH] use includes instead of indexOf --- src/sliceActions/intersectionsToShapes.js | 2 +- src/sliceActions/optimizePaths.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sliceActions/intersectionsToShapes.js b/src/sliceActions/intersectionsToShapes.js index f06e7c0..3081dc5 100644 --- a/src/sliceActions/intersectionsToShapes.js +++ b/src/sliceActions/intersectionsToShapes.js @@ -87,7 +87,7 @@ export default function intersectionsToShapes(layerIntersectionIndexes, layerInt index = firstPoints[0]; while (index !== -1) { - if (firstPoints.indexOf(index) === -1) { + if (!firstPoints.includes(index)) { const intersection = intersectionPoints[index]; shape.unshift(intersection); diff --git a/src/sliceActions/optimizePaths.js b/src/sliceActions/optimizePaths.js index 2e69933..00b2b41 100644 --- a/src/sliceActions/optimizePaths.js +++ b/src/sliceActions/optimizePaths.js @@ -95,7 +95,7 @@ function optimizeShape(shape, start) { let pathIndex; for (let i = 0; i < inputPaths.length; i ++) { - if (donePaths.indexOf(i) !== -1) continue; + if (donePaths.includes(i)) continue; const path = inputPaths[i];