Skip to content

Commit

Permalink
attempt to conquer weird
Browse files Browse the repository at this point in the history
  • Loading branch information
tgruben committed May 31, 2017
1 parent e12fdb6 commit f584400
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions roaring/roaring.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ func (b *Bitmap) Add(a ...uint64) (changed bool, err error) {

return changed, nil
}
func (b *Bitmap) String() string {
var buffer bytes.Buffer
for i, v := range b.Slice() {
if i > 0 {
buffer.WriteString(" ")
}
buffer.WriteString(fmt.Sprintf("%d", v))
}
return buffer.String()
}

func (b *Bitmap) add(v uint64) bool {
hb := highbits(v)
i := search64(b.keys, hb)
Expand Down Expand Up @@ -220,6 +209,19 @@ func (b *Bitmap) CountRange(start, end uint64) (n uint64) {
return n
}

//Stringify method for debuging.
func (b *Bitmap) String() string {
var buffer bytes.Buffer
for i, v := range b.Slice() {
if i > 0 {
buffer.WriteString(" ")
}
buffer.WriteString(fmt.Sprintf("%d", v))
}
return buffer.String()
}


// Slice returns a slice of all integers in the bitmap.
func (b *Bitmap) Slice() []uint64 {
var a []uint64
Expand Down

0 comments on commit f584400

Please sign in to comment.