bitset

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSet

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

BitSet is a specialized bitset that does not perform heap allocations if the range of values in the bitset is small (e.g., [0, 64)). It falls back to github.com/willf/bitset for large value ranges.

func New

func New(maxExclusive uint) BitSet

New can be used to keep track of values between [0, maxExclusive). Calling APIs with values outside that range may lead to incorrect results.

func (*BitSet) All

func (bs *BitSet) All(maxExclusive uint) bool

All returns true if all the bits for values between [0, maxExclusive) are set.

func (*BitSet) Set

func (bs *BitSet) Set(i uint)

Set sets the bit associated with the given value.

Jump to

Keyboard shortcuts

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