Hey,
Although Quantize already includes tests for overlapping
|
It("overlaps if from in another range", func() { |
|
Expect(qRange.RangeOverlaps(editor.QuantizeRange{ |
|
From: 1.5, |
|
To: 3, |
|
})).To(BeTrue()) |
|
}) |
we don't make use of it after parsing the ranges.
We can make an O(n^2) checking over the ranges and that should be fine:
for i, _ := range ranges:
for k, _ := range ranges:
if i == k: continue
if ranges[i].overlaps(ranges[k]):
error
thx!
Hey,
Although
Quantizealready includes tests for overlappingasciinema-edit/editor/quantize_test.go
Lines 75 to 80 in c33b7f4
we don't make use of it after parsing the ranges.
We can make an
O(n^2)checking over the ranges and that should be fine:thx!