Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is necessary or else the last else if will never be executed and the function returns wrong results for some cases. For example, these tests will not run without this change: TestRemoveRangeSameStart() { i := NewIntervalSet() i.addInterval(antlr.NewInterval(1, 10)) i.removeRange(antlr.NewInterval(1, 7)) suite.Len(i.intervals, 1) suite.Equal(7, i.intervals[0].Start) suite.Equal(10, i.intervals[0].Stop) } TestRemoveRangeOverStartBound() { i := NewIntervalSet() i.addInterval(antlr.NewInterval(5, 15)) i.removeRange(antlr.NewInterval(1, 10)) suite.Len(i.intervals, 1) suite.Equal(10, i.intervals[0].Start) suite.Equal(15, i.intervals[0].Stop) } Signed-off-by: Gustavo de Morais <[email protected]>
- Loading branch information