libnetwork/bitmap: improve documentation

Clarify that the argument to New is an exclusive upper bound.

Correct the documentation for SetAnyInRange: the end argument is
inclusive rather than exclusive.

Signed-off-by: Cory Snider <csnider@mirantis.com>
This commit is contained in:
Cory Snider 2023-07-05 15:33:03 -04:00
parent 0fc6bf9a6e
commit 564a13285f

View file

@ -47,7 +47,7 @@ type Bitmap struct {
noCopy noCopy
}
// NewHandle returns a new Bitmap n bits long.
// NewHandle returns a new Bitmap of ordinals in the interval [0, n).
func New(n uint64) *Bitmap {
return &Bitmap{
bits: n,
@ -176,7 +176,7 @@ func (s *sequence) fromByteArray(data []byte) error {
return nil
}
// SetAnyInRange sets the first unset bit in the range [start, end) and returns
// SetAnyInRange sets the first unset bit in the range [start, end] and returns
// the ordinal of the set bit.
//
// When serial=true, the bitmap is scanned starting from the ordinal following