Commit d5d1b9b3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8c3b57c9
...@@ -121,7 +121,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) { ...@@ -121,7 +121,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) {
// clear range for r and insert new entry // clear range for r and insert new entry
// TODO optimize for same-value/set case (just merge all covered // TODO optimize for same-value/set case (just merge all covered
// entries into one - - see commented AddRange from set vvv) // entries into one - see commented AddRange from set vvv)
i := M.delRange(r) i := M.delRange(r)
vInsert(&M.entryv, i, e) vInsert(&M.entryv, i, e)
debugfRMap("\tinsert %s\t-> %s\n", e, M) debugfRMap("\tinsert %s\t-> %s\n", e, M)
...@@ -277,8 +277,6 @@ func (M *RangedMap) delRange(r KeyRange) (i int) { ...@@ -277,8 +277,6 @@ func (M *RangedMap) delRange(r KeyRange) (i int) {
return 0 return 0
} }
// XXX if jhi - ilo == 0 { return "non-overlap" } ?
// [ilo+1:jhi-1] should be deleted // [ilo+1:jhi-1] should be deleted
// [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked, // [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked,
// or split+shrinked if ilo==jhi-1 and r is inside [ilo] // or split+shrinked if ilo==jhi-1 and r is inside [ilo]
......
...@@ -123,7 +123,7 @@ func (M *_RangedMap_str) SetRange(r KeyRange, v string) { ...@@ -123,7 +123,7 @@ func (M *_RangedMap_str) SetRange(r KeyRange, v string) {
// clear range for r and insert new entry // clear range for r and insert new entry
// TODO optimize for same-value/set case (just merge all covered // TODO optimize for same-value/set case (just merge all covered
// entries into one - - see commented AddRange from set vvv) // entries into one - see commented AddRange from set vvv)
i := M.delRange(r) i := M.delRange(r)
vInsert__RangedMap_str(&M.entryv, i, e) vInsert__RangedMap_str(&M.entryv, i, e)
debugf_RangedMap_str("\tinsert %s\t-> %s\n", e, M) debugf_RangedMap_str("\tinsert %s\t-> %s\n", e, M)
...@@ -279,8 +279,6 @@ func (M *_RangedMap_str) delRange(r KeyRange) (i int) { ...@@ -279,8 +279,6 @@ func (M *_RangedMap_str) delRange(r KeyRange) (i int) {
return 0 return 0
} }
// XXX if jhi - ilo == 0 { return "non-overlap" } ?
// [ilo+1:jhi-1] should be deleted // [ilo+1:jhi-1] should be deleted
// [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked, // [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked,
// or split+shrinked if ilo==jhi-1 and r is inside [ilo] // or split+shrinked if ilo==jhi-1 and r is inside [ilo]
......
...@@ -123,7 +123,7 @@ func (M *_RangedMap_void) SetRange(r KeyRange, v void) { ...@@ -123,7 +123,7 @@ func (M *_RangedMap_void) SetRange(r KeyRange, v void) {
// clear range for r and insert new entry // clear range for r and insert new entry
// TODO optimize for same-value/set case (just merge all covered // TODO optimize for same-value/set case (just merge all covered
// entries into one - - see commented AddRange from set vvv) // entries into one - see commented AddRange from set vvv)
i := M.delRange(r) i := M.delRange(r)
vInsert__RangedMap_void(&M.entryv, i, e) vInsert__RangedMap_void(&M.entryv, i, e)
debugf_RangedMap_void("\tinsert %s\t-> %s\n", e, M) debugf_RangedMap_void("\tinsert %s\t-> %s\n", e, M)
...@@ -279,8 +279,6 @@ func (M *_RangedMap_void) delRange(r KeyRange) (i int) { ...@@ -279,8 +279,6 @@ func (M *_RangedMap_void) delRange(r KeyRange) (i int) {
return 0 return 0
} }
// XXX if jhi - ilo == 0 { return "non-overlap" } ?
// [ilo+1:jhi-1] should be deleted // [ilo+1:jhi-1] should be deleted
// [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked, // [ilo] and [jhi-1] overlap with [r.lo,r.hi) - they should be deleted, or shrinked,
// or split+shrinked if ilo==jhi-1 and r is inside [ilo] // or split+shrinked if ilo==jhi-1 and r is inside [ilo]
......
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