From f584400330a35b97624e4d718987cc205aaaf029 Mon Sep 17 00:00:00 2001 From: Todd Gruben Date: Wed, 31 May 2017 16:10:48 -0500 Subject: [PATCH] attempt to conquer weird --- roaring/roaring.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/roaring/roaring.go b/roaring/roaring.go index 63b9698d0..9fb66ce1b 100644 --- a/roaring/roaring.go +++ b/roaring/roaring.go @@ -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) @@ -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