Skip to content

Commit 7206dcb

Browse files
committed
comments
1 parent 2d85bf4 commit 7206dcb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/trie/bitarray.go

+3
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func (b *BitArray) LSBsFromLSB(x *BitArray, n uint8) *BitArray {
104104
}
105105

106106
// Returns the least significant bits of `x` with `n` counted from the most significant bit, starting at 0.
107+
// Think of this method as array[n:]
107108
// For example:
108109
//
109110
// x = 11001011 (len=8)
@@ -159,6 +160,7 @@ func (b *BitArray) EqualMSBs(x *BitArray) bool {
159160

160161
// Sets the bit array to the most significant 'n' bits of x, that is position 0 to n (exclusive).
161162
// If n >= x.len, the bit array is an exact copy of x.
163+
// Think of this method as array[0:n]
162164
// For example:
163165
//
164166
// x = 11001011 (len=8)
@@ -327,6 +329,7 @@ func (b *BitArray) AppendBit(x *BitArray, bit uint8) *BitArray {
327329
// Sets the bit array to a subset of x from startPos (inclusive) to endPos (exclusive),
328330
// where position 0 is the MSB. If startPos >= endPos or if startPos >= x.len,
329331
// returns an empty BitArray.
332+
// Think of this method as array[start:end]
330333
// For example:
331334
//
332335
// x = 001011011 (len=9)

0 commit comments

Comments
 (0)