BitLen returns the number of bits stored.
()
| 94 | |
| 95 | // BitLen returns the number of bits stored. |
| 96 | func (d BitArray) BitLen() uint { |
| 97 | if len(d.words) == 0 { |
| 98 | return 0 |
| 99 | } |
| 100 | return d.nonEmptyBitLen() |
| 101 | } |
| 102 | |
| 103 | func (d BitArray) nonEmptyBitLen() uint { |
| 104 | return uint(len(d.words)-1)*numBitsPerWord + uint(d.lastBitsUsed) |
no test coverage detected