MCPcopy Create free account
hub / github.com/apache/kvrocks / GetBitFromByte

Function GetBitFromByte

src/common/bit_util.h:77–77  ·  view source on GitHub ↗

Gets the i-th bit from a byte. Should only be used with i <= 7.

Source from the content-addressed store, hash-verified

75
76// Gets the i-th bit from a byte. Should only be used with i <= 7.
77static constexpr bool GetBitFromByte(uint8_t byte, uint8_t i) { return byte & kBitmask[i]; }
78
79static inline void SetBitTo(uint8_t *bits, int64_t i, bool bit_is_set) {
80 // https://graphics.stanford.edu/~seander/bithacks.html

Callers 1

BitPosMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected