Commit 6b630059 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7a488495
...@@ -94,6 +94,7 @@ func (S *RangeSet) AddRange(r Range) { ...@@ -94,6 +94,7 @@ func (S *RangeSet) AddRange(r Range) {
S.rangev[:ilo], append([]Range{ S.rangev[:ilo], append([]Range{
Range{lo, hi_}}, Range{lo, hi_}},
S.rangev[jhi:]...)...) S.rangev[jhi:]...)...)
// debugfRangeSet("\tmerge [%d:%d] -> %s\n", S)
} }
// if [r.lo,r.hi) was outside of any entry - create new entry // if [r.lo,r.hi) was outside of any entry - create new entry
...@@ -123,7 +124,14 @@ func (S *RangeSet) AddRange(r Range) { ...@@ -123,7 +124,14 @@ func (S *RangeSet) AddRange(r Range) {
} }
} }
// XXX left if ilo > 0 { // left
if S.rangev[ilo-1].hi_ == S.rangev[ilo].lo {
S.rangev = append(
S.rangev[:ilo-1], append([]Range{
Range{S.rangev[ilo-1].lo, S.rangev[ilo].hi_}},
S.rangev[ilo+1:]...)...)
}
}
// done // done
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment