Commit 682dc8b0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 485f8c21
...@@ -370,7 +370,7 @@ func (M *RangedMap) Clear() { ...@@ -370,7 +370,7 @@ func (M *RangedMap) Clear() {
// AllRanges returns slice of all key ranges in the set. // AllRanges returns slice of all key ranges in the set.
// //
// TODO -> iter? // TODO -> iter?
func (M *RangedKeySet) AllRanges() /*readonly*/[]RangedMapEntry { func (M *RangedMap) AllRanges() /*readonly*/[]RangedMapEntry {
return M.entryv return M.entryv
} }
...@@ -388,7 +388,7 @@ func (M RangedMap) String() string { ...@@ -388,7 +388,7 @@ func (M RangedMap) String() string {
} }
func (e *RangedMapEntry) String() string { func (e *RangedMapEntry) String() string {
s := e.keycov.String() s := e.KeyRange.String()
v := fmt.Sprintf("%v", e.Value) v := fmt.Sprintf("%v", e.Value)
if v != "" { // omit ":<v>" in the case of set if v != "" { // omit ":<v>" in the case of set
s += ":" + v s += ":" + v
......
...@@ -26,7 +26,7 @@ package blib ...@@ -26,7 +26,7 @@ package blib
// //
// Zero value represents empty set. // Zero value represents empty set.
type RangedKeySet struct { type RangedKeySet struct {
m _RangedMap_void // XXX naming m _RangedMap_void
} }
// void is used as value type for RangedMap to be used as set. // void is used as value type for RangedMap to be used as set.
...@@ -89,7 +89,8 @@ func (A *RangedKeySet) UnionInplace(B *RangedKeySet) { ...@@ -89,7 +89,8 @@ func (A *RangedKeySet) UnionInplace(B *RangedKeySet) {
defer A.verify() defer A.verify()
// XXX dumb // XXX dumb
for _, r := range B.rangev { //for _, r := range B.rangev {
for _, r := range B.AllRanges() {
A.AddRange(r) A.AddRange(r)
} }
} }
......
...@@ -372,7 +372,7 @@ func (M *_RangedMap_void) Clear() { ...@@ -372,7 +372,7 @@ func (M *_RangedMap_void) Clear() {
// AllRanges returns slice of all key ranges in the set. // AllRanges returns slice of all key ranges in the set.
// //
// TODO -> iter? // TODO -> iter?
func (M *RangedKeySet) AllRanges() /*readonly*/[]_RangedMap_voidEntry { func (M *_RangedMap_void) AllRanges() /*readonly*/[]_RangedMap_voidEntry {
return M.entryv return M.entryv
} }
...@@ -390,7 +390,7 @@ func (M _RangedMap_void) String() string { ...@@ -390,7 +390,7 @@ func (M _RangedMap_void) String() string {
} }
func (e *_RangedMap_voidEntry) String() string { func (e *_RangedMap_voidEntry) String() string {
s := e.keycov.String() s := e.KeyRange.String()
v := fmt.Sprintf("%v", e.Value) v := fmt.Sprintf("%v", e.Value)
if v != "" { // omit ":<v>" in the case of set if v != "" { // omit ":<v>" in the case of set
s += ":" + v 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