Simplified rangesOverlap function
This commit is contained in:
parent
f180b38cb3
commit
7dd504945c
@ -22,9 +22,7 @@ function rangesOverlap(range1, range2, tollerance=0) {
|
|||||||
range2 = [...range2].sort((a, b) => a - b);
|
range2 = [...range2].sort((a, b) => a - b);
|
||||||
return (
|
return (
|
||||||
(range1[0] >= range2[0] - t && range1[0] <= range2[1] + t) ||
|
(range1[0] >= range2[0] - t && range1[0] <= range2[1] + t) ||
|
||||||
(range1[1] >= range2[0] - t && range1[1] <= range2[1] + t) ||
|
(range2[0] >= range1[0] - t && range2[0] <= range1[1] + t)
|
||||||
(range2[0] >= range1[0] - t && range2[0] <= range1[1] + t) ||
|
|
||||||
(range2[1] >= range1[0] - t && range2[1] <= range1[1] + t)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user