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

.

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