Commit edfb66a5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 696428d9
...@@ -168,7 +168,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) { ...@@ -168,7 +168,7 @@ func (M *RangedMap) SetRange(r KeyRange, v VALUE) {
} }
// DelRange removes range r from the map. // DelRange removes range r from the map.
func (M *RangedKeySet) DelRange(r KeyRange) { func (M *RangedMap) DelRange(r KeyRange) {
if traceRangeSet { if traceRangeSet {
fmt.Printf("\n\nDelRange:\n") fmt.Printf("\n\nDelRange:\n")
fmt.Printf(" M: %s\n", M) fmt.Printf(" M: %s\n", M)
...@@ -238,7 +238,7 @@ func (M *RangedKeySet) DelRange(r KeyRange) { ...@@ -238,7 +238,7 @@ func (M *RangedKeySet) DelRange(r KeyRange) {
} }
// HasRange returns whether all keys from range r belong to the set. // HasRange returns whether all keys from range r belong to the set.
func (S *RangedKeySet) HasRange(r KeyRange) (yes bool) { func (S *RangedMap) HasRange(r KeyRange) (yes bool) {
if traceRangeSet { if traceRangeSet {
fmt.Printf("\n\nHasRange:\n") fmt.Printf("\n\nHasRange:\n")
fmt.Printf(" S: %s\n", S) fmt.Printf(" S: %s\n", S)
...@@ -313,10 +313,12 @@ func (M *RangedMap) verify() { ...@@ -313,10 +313,12 @@ func (M *RangedMap) verify() {
} }
} }
// Clone returns copy of the set. // Clone returns copy of the map.
func (orig *RangedKeySet) Clone() *RangedKeySet { //
klon := &RangedKeySet{} // NOTE values are _not_ cloned.
klon.rangev = append(klon.rangev, orig.rangev...) func (orig *RangedMap) Clone() *RangedMap {
klon := &RangedMap{}
klon.entryv = append(klon.entryv, orig.entryv...)
return klon return klon
} }
...@@ -326,13 +328,13 @@ func (M *RangedMap) Empty() bool { ...@@ -326,13 +328,13 @@ func (M *RangedMap) Empty() bool {
} }
// Equal returns whether A == B. // Equal returns whether A == B.
func (A *RangedKeySet) Equal(B *RangedKeySet) bool { func (A *RangedMap) Equal(B *RangedMap) bool {
if len(A.rangev) != len(B.rangev) { if len(A.entryv) != len(B.entryv) {
return false return false
} }
for i, ra := range A.rangev { for i, ea := range A.entryv {
rb := B.rangev[i] eb := B.entryv[i]
if ra != rb { if ea != eb {
return false return false
} }
} }
......
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