MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / GetBit

Method GetBit

structure/bitmap_1.go:104–116  ·  view source on GitHub ↗

GetBit Get the value of the bit at the specified offset in the bitmap If the key does not exist, it returns an error

(key string, offset uint)

Source from the content-addressed store, hash-verified

102// GetBit Get the value of the bit at the specified offset in the bitmap
103// If the key does not exist, it returns an error
104func (b *BitMapStructure) GetBit(key string, offset uint) (bool, error) {
105 bitmap, length, err := b.getBitmapFromDB(key, false)
106 if err != nil {
107 return false, err
108 }
109
110 // If the offset is out of range, default value is false
111 if offset >= length {
112 return false, nil
113 }
114
115 return b.getBit(bitmap, offset), nil
116}
117
118// GetBits Get the values of a group of bits at the specified offsets in the bitmap
119// If the key does not exist, it returns an error

Callers 1

Calls 2

getBitmapFromDBMethod · 0.95
getBitMethod · 0.95

Tested by 1