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

Function newBitSet

structure/bitmap.go:346–356  ·  view source on GitHub ↗

newBitSet function creates a new bitset from the provided bytes

(d []byte)

Source from the content-addressed store, hash-verified

344
345// newBitSet function creates a new bitset from the provided bytes
346func newBitSet(d []byte) (*BitSet, error) {
347 // Create a new bitset
348 b := bitset.New(1)
349 // Unmarshal the provided bytes into the bitset
350 err := b.UnmarshalBinary(d)
351 if err != nil {
352 return nil, err
353 }
354 // Return the bitset
355 return &BitSet{b: b}, nil
356}
357
358// At function checks if the bit at the specified position is set
359func (b *BitSet) At(pos uint) bool {

Callers 1

GetBitsMethod · 0.85

Calls 1

UnmarshalBinaryMethod · 0.45

Tested by

no test coverage detected