Commit f90c9e7e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ac78bcc6
...@@ -61,7 +61,7 @@ func (S *RangeSet) AddRange(r Range) { ...@@ -61,7 +61,7 @@ func (S *RangeSet) AddRange(r Range) {
fmt.Printf("\n\nAddRange:\n") fmt.Printf("\n\nAddRange:\n")
fmt.Printf(" S: %s\n", S) fmt.Printf(" S: %s\n", S)
fmt.Printf(" r: %s\n", r) fmt.Printf(" r: %s\n", r)
defer fmt.Printf("->S: %s\n", S) defer fmt.Printf("->u: %s\n", S)
} }
S.verify() S.verify()
...@@ -114,7 +114,7 @@ func (S *RangeSet) AddRange(r Range) { ...@@ -114,7 +114,7 @@ func (S *RangeSet) AddRange(r Range) {
} }
// and check if we should merge it with right/left neighbours // and check if we should merge it with right/left neighbours
if ilo < len(S.rangev) { if ilo+1 < len(S.rangev) { // right
if S.rangev[ilo].hi_ == S.rangev[ilo+1].lo { if S.rangev[ilo].hi_ == S.rangev[ilo+1].lo {
S.rangev = append( S.rangev = append(
S.rangev[:ilo], append([]Range{ S.rangev[:ilo], append([]Range{
...@@ -123,6 +123,8 @@ func (S *RangeSet) AddRange(r Range) { ...@@ -123,6 +123,8 @@ func (S *RangeSet) AddRange(r Range) {
} }
} }
// XXX left
// done // done
} }
...@@ -132,7 +134,7 @@ func (S *RangeSet) DelRange(r Range) { ...@@ -132,7 +134,7 @@ func (S *RangeSet) DelRange(r Range) {
fmt.Printf("\n\nDelRange:\n") fmt.Printf("\n\nDelRange:\n")
fmt.Printf(" S: %s\n", S) fmt.Printf(" S: %s\n", S)
fmt.Printf(" r: %s\n", r) fmt.Printf(" r: %s\n", r)
defer fmt.Printf("->S: %s\n", S) defer fmt.Printf("->d: %s\n", S)
} }
S.verify() S.verify()
......
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