Skip to content

Check overlapping quantization ranges before applying transfomation #6

@cirocosta

Description

@cirocosta

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions