Commit 21b2dc8f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c0074933
...@@ -386,28 +386,28 @@ func debugfRMap(format string, argv ...interface{}) { ...@@ -386,28 +386,28 @@ func debugfRMap(format string, argv ...interface{}) {
// ---- slice ops ---- // ---- slice ops ----
// vInsert inserts r into *pv[i]. // vInsert inserts e into *pv[i].
func vInsert(pv *[]KeyRange, i int, r KeyRange) { func vInsert(pv *[]RangeMapEntry, i int, e RangeMapEntry) {
v := *pv v := *pv
v = append(v, KeyRange{}) v = append(v, RangeMapEntry{})
copy(v[i+1:], v[i:]) copy(v[i+1:], v[i:])
v[i] = r v[i] = e
*pv = v *pv = v
} }
// vDeleteSlice deletes *pv[lo:hi]. // vDeleteSlice deletes *pv[lo:hi].
func vDeleteSlice(pv *[]KeyRange, lo,hi int) { func vDeleteSlice(pv *[]RangeMapEntry, lo,hi int) {
v := *pv v := *pv
n := copy(v[lo:], v[hi:]) n := copy(v[lo:], v[hi:])
v = v[:lo+n] v = v[:lo+n]
*pv = v *pv = v
} }
// vReplaceSlice replaces *pv[lo:hi] with r. // vReplaceSlice replaces *pv[lo:hi] with e.
func vReplaceSlice(pv *[]KeyRange, lo,hi int, r KeyRange) { func vReplaceSlice(pv *[]RangeMapEntry, lo,hi int, e RangeMapEntry) {
v := *pv v := *pv
n := copy(v[lo+1:], v[hi:]) n := copy(v[lo+1:], v[hi:])
v[lo] = r v[lo] = e
v = v[:lo+1+n] v = v[:lo+1+n]
*pv = v *pv = v
} }
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