Commit 485f8c21 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1489a805
......@@ -99,7 +99,7 @@ func (M *RangedMap) Get_(k Key) (v VALUE, ok bool) {
}
// found
return e.value, true
return e.Value, true
}
// SetRange changes M to map key range r to value v.
......@@ -170,7 +170,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) {
// and check if we should merge it with right/left neighbours
if ilo+1 < len(M.entryv) { // right
if M.entryv[ilo].Hi_+1 == M.entryv[ilo+1].Lo { // XXX && .value same
if M.entryv[ilo].Hi_+1 == M.entryv[ilo+1].Lo { // XXX && .Value same
vReplaceSlice(&M.entryv, ilo,ilo+2,
KeyRange{M.entryv[ilo].Lo, M.entryv[ilo+1].Hi_})
debugfRMap("\tmerge right\t-> %s\n", M)
......@@ -178,7 +178,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) {
}
if ilo > 0 { // left
if M.entryv[ilo-1].Hi_+1 == M.entryv[ilo].Lo { // XXX && .value same
if M.entryv[ilo-1].Hi_+1 == M.entryv[ilo].Lo { // XXX && .Value same
vReplaceSlice(&M.entryv, ilo-1,ilo+1,
KeyRange{M.entryv[ilo-1].Lo, M.entryv[ilo].Hi_})
debugfRMap("\tmerge left\t-> %s\n", M)
......@@ -316,7 +316,7 @@ func (M *RangedMap) verify() {
for i, e := range M.entryv {
hiPrev := hi_Prev + 1
if i > 0 {
if (e.value == v_Prev) {
if (e.Value == v_Prev) {
if !(hiPrev < e.Lo) { // NOTE not ≤ - adjacent ranges must be merged
badf("[%d]: same value: !(hiPrev < e.lo)", i)
}
......@@ -330,7 +330,7 @@ func (M *RangedMap) verify() {
badf("[%d]: !(e.lo ≤ e.hi_)", i)
}
hi_Prev = e.Hi_
v_Prev = e.value
v_Prev = e.Value
}
}
......@@ -389,7 +389,7 @@ func (M RangedMap) String() string {
func (e *RangedMapEntry) String() string {
s := e.keycov.String()
v := fmt.Sprintf("%v", e.value)
v := fmt.Sprintf("%v", e.Value)
if v != "" { // omit ":<v>" in the case of set
s += ":" + v
}
......
......@@ -118,7 +118,7 @@ func (S *RangedKeySet) verify() {
// Clone returns copy of the set.
func (orig *RangedKeySet) Clone() *RangedKeySet {
return &RangedKeySet{orig.m.Clone()}
return &RangedKeySet{*orig.m.Clone()}
}
// Empty returns whether the set is empty.
......@@ -128,7 +128,7 @@ func (S *RangedKeySet) Empty() bool {
// Equal returns whether A == B.
func (A *RangedKeySet) Equal(B *RangedKeySet) bool {
return A.m.Equal(B.m)
return A.m.Equal(&B.m)
}
// Clear removes all elements from the set.
......
......@@ -101,7 +101,7 @@ func (M *_RangedMap_void) Get_(k Key) (v void, ok bool) {
}
// found
return e.value, true
return e.Value, true
}
// SetRange changes M to map key range r to value v.
......@@ -172,7 +172,7 @@ func (M *_RangedMap_void) SetRange(r KeyRange, v void) {
// and check if we should merge it with right/left neighbours
if ilo+1 < len(M.entryv) { // right
if M.entryv[ilo].Hi_+1 == M.entryv[ilo+1].Lo { // XXX && .value same
if M.entryv[ilo].Hi_+1 == M.entryv[ilo+1].Lo { // XXX && .Value same
vReplaceSlice__RangedMap_void(&M.entryv, ilo,ilo+2,
KeyRange{M.entryv[ilo].Lo, M.entryv[ilo+1].Hi_})
debugf_RangedMap_void("\tmerge right\t-> %s\n", M)
......@@ -180,7 +180,7 @@ func (M *_RangedMap_void) SetRange(r KeyRange, v void) {
}
if ilo > 0 { // left
if M.entryv[ilo-1].Hi_+1 == M.entryv[ilo].Lo { // XXX && .value same
if M.entryv[ilo-1].Hi_+1 == M.entryv[ilo].Lo { // XXX && .Value same
vReplaceSlice__RangedMap_void(&M.entryv, ilo-1,ilo+1,
KeyRange{M.entryv[ilo-1].Lo, M.entryv[ilo].Hi_})
debugf_RangedMap_void("\tmerge left\t-> %s\n", M)
......@@ -318,7 +318,7 @@ func (M *_RangedMap_void) verify() {
for i, e := range M.entryv {
hiPrev := hi_Prev + 1
if i > 0 {
if (e.value == v_Prev) {
if (e.Value == v_Prev) {
if !(hiPrev < e.Lo) { // NOTE not ≤ - adjacent ranges must be merged
badf("[%d]: same value: !(hiPrev < e.lo)", i)
}
......@@ -332,7 +332,7 @@ func (M *_RangedMap_void) verify() {
badf("[%d]: !(e.lo ≤ e.hi_)", i)
}
hi_Prev = e.Hi_
v_Prev = e.value
v_Prev = e.Value
}
}
......@@ -391,7 +391,7 @@ func (M _RangedMap_void) String() string {
func (e *_RangedMap_voidEntry) String() string {
s := e.keycov.String()
v := fmt.Sprintf("%v", e.value)
v := fmt.Sprintf("%v", e.Value)
if v != "" { // omit ":<v>" in the case of set
s += ":" + 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