Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Here, in go, if we assign a slice position to a variable, we'll have a copy. ki.Start = v + 1, on line 218, was just modifying a copy, which is not what was intended to be done here. If we get the reference as done in the change, we'll modify `ki.Start`properly. Another option would be to reasign the copy to the array position. Either way, this should be fixed. Simple test which would fail: func (suite *IIntervalSetTestSuite) TestRemoveOne() { i := NewIntervalSet() i.addInterval(antlr.NewInterval(5, 10)) i.removeOne(7) suite.Len(i.intervals, 2) suite.Equal(5, i.intervals[0].Start) suite.Equal(7, i.intervals[0].Stop) suite.Equal(8, i.intervals[1].Start) suite.Equal(10, i.intervals[1].Stop) } Signed-off-by: Gustavo de Morais <[email protected]>
- Loading branch information