GetBits returns b's underlying storage with used bits cleared. GetBits may modify the underlying storage.
()
| 40 | // GetBits returns b's underlying storage with used bits cleared. |
| 41 | // GetBits may modify the underlying storage. |
| 42 | func (b Bits) GetBits() []uint64 { |
| 43 | if unusedBits := 64 - (b.length % 64); unusedBits < 64 { |
| 44 | // Clear unused bits. |
| 45 | mask := ^uint64(0) >> unusedBits |
| 46 | b.bits[len(b.bits)-1] &= mask |
| 47 | } |
| 48 | return b.bits |
| 49 | } |
| 50 | |
| 51 | func (b Bits) IsSet(slot uint32) bool { |
| 52 | return !b.IsZero() && b.IsSetDirect(slot) |
no outgoing calls