get32BitsFast requires that at least one bit is requested every time. There are no checks if the buffer is filled.
(n uint8)
| 58 | // get32BitsFast requires that at least one bit is requested every time. |
| 59 | // There are no checks if the buffer is filled. |
| 60 | func (b *bitReader) get32BitsFast(n uint8) uint32 { |
| 61 | const regMask = 64 - 1 |
| 62 | v := uint32((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) |
| 63 | b.bitsRead += n |
| 64 | return v |
| 65 | } |
| 66 | |
| 67 | // fillFast() will make sure at least 32 bits are available. |
| 68 | // There must be at least 4 bytes available. |
no outgoing calls
no test coverage detected