Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Jan 20, 2025
1 parent 2d85bf4 commit 7206dcb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/trie/bitarray.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func (b *BitArray) LSBsFromLSB(x *BitArray, n uint8) *BitArray {
}

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

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

0 comments on commit 7206dcb

Please sign in to comment.