Browse code

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>

Cory Snider authored on 2023/07/06 04:33:03
Showing 1 changed files
... ...
@@ -47,7 +47,7 @@ type Bitmap struct {
47 47
 	noCopy noCopy
48 48
 }
49 49
 
50
-// NewHandle returns a new Bitmap n bits long.
50
+// NewHandle returns a new Bitmap of ordinals in the interval [0, n).
51 51
 func New(n uint64) *Bitmap {
52 52
 	return &Bitmap{
53 53
 		bits:       n,
... ...
@@ -176,7 +176,7 @@ func (s *sequence) fromByteArray(data []byte) error {
176 176
 	return nil
177 177
 }
178 178
 
179
-// SetAnyInRange sets the first unset bit in the range [start, end) and returns
179
+// SetAnyInRange sets the first unset bit in the range [start, end] and returns
180 180
 // the ordinal of the set bit.
181 181
 //
182 182
 // When serial=true, the bitmap is scanned starting from the ordinal following