BitLen returns the number of bits stored.
()
| 80 | |
| 81 | // BitLen returns the number of bits stored. |
| 82 | func (d BitArray) BitLen() uint { |
| 83 | if len(d.words) == 0 { |
| 84 | return 0 |
| 85 | } |
| 86 | return d.nonEmptyBitLen() |
| 87 | } |
| 88 | |
| 89 | func (d BitArray) nonEmptyBitLen() uint { |
| 90 | return uint(len(d.words)-1)*numBitsPerWord + uint(d.lastBitsUsed) |
no test coverage detected