Quellcode durchsuchen

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 vor 2 Jahren
Ursprung
Commit
564a13285f
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      libnetwork/bitmap/sequence.go

+ 2 - 2
libnetwork/bitmap/sequence.go

@@ -47,7 +47,7 @@ type Bitmap struct {
 	noCopy noCopy
 	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 {
 func New(n uint64) *Bitmap {
 	return &Bitmap{
 	return &Bitmap{
 		bits:       n,
 		bits:       n,
@@ -176,7 +176,7 @@ func (s *sequence) fromByteArray(data []byte) error {
 	return nil
 	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.
 // the ordinal of the set bit.
 //
 //
 // When serial=true, the bitmap is scanned starting from the ordinal following
 // When serial=true, the bitmap is scanned starting from the ordinal following