Skip to content
Snippets Groups Projects
Commit ccb7c4b5 authored by Yuriy Maksymets's avatar Yuriy Maksymets
Browse files

Comply to new ESLint rules

parent bf07570a
No related branches found
No related tags found
2 merge requests!57Erasure intervals,!48Intuitive erasing
Pipeline #103561 passed
......@@ -19,9 +19,9 @@ function cap01(x) {
}
function distToSegmentSquared(lineStart, lineEnd, point) {
var l2 = distanceSquared(lineStart, lineEnd)
const l2 = distanceSquared(lineStart, lineEnd)
if (l2 === 0) return distanceSquared(point, lineStart)
var t =
let t =
((point[0] - lineStart[0]) * (lineEnd[0] - lineStart[0]) +
(point[1] - lineStart[1]) * (lineEnd[1] - lineStart[1])) /
l2
......@@ -100,7 +100,7 @@ function mergeIntervals(...intervals) {
if (!intervals.length) return []
const sorted = intervals.sort(([a], [b]) => a > b)
let stack = [sorted[0]]
const stack = [sorted[0]]
sorted.forEach((x) => {
const top = stack[stack.length - 1]
if (overlaps(x, top)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment