Commit edfb66a5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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