Get a bit from the specified byte, numbered like this: bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
| 411 | // Get a bit from the specified byte, numbered like this: |
| 412 | // bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 413 | bool ByteVector::getBit2(size_t byteIndex, unsigned bitIndex) const |
| 414 | { |
| 415 | BVASSERT(bitIndex >= 0 && bitIndex <= 7); |
| 416 | //return !!(getByte(byteIndex) & (1 << (7-bitIndex))); |
| 417 | return !!(getByte(byteIndex) & bitMasks[bitIndex]); |
| 418 | } |
| 419 | |
| 420 | // Get a bit from the specified byte, numbered like this: |
| 421 | // bits: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
no outgoing calls
no test coverage detected