bitmap

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmap

type Bitmap struct {
	// contains filtered or unexported fields
}

bitmap is a lazily initialized bitmap

func New

func New(max uint32) *Bitmap

func (*Bitmap) Add

func (b *Bitmap) Add(n uint32)

add sets n in the bitmap.

bits will be expanded as needed.

If n is greater than max, the call has no effect.

func (*Bitmap) Next

func (b *Bitmap) Next() (uint32, bool)

next sets and returns the lowest unset bit in the bitmap.

bits will be expanded if necessary.

If there are no unset bits below max, the second return value will be false.

func (*Bitmap) Remove

func (b *Bitmap) Remove(n uint32)

remove clears n from the bitmap.

If n is not set or greater than max the call has not effect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL