mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 17:15:56 +00:00
attempt to conquer weird
This commit is contained in:
parent
e12fdb69a1
commit
f584400330
1 changed files with 13 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue