github.com/tobgu/qframe@v0.4.0/internal/ecolumn/bitset.go (about) 1 package ecolumn 2 3 import "fmt" 4 5 // Helper type for multi value filtering 6 type bitset [4]uint64 7 8 func (s *bitset) set(val enumVal) { 9 s[val>>6] |= 1 << (val & 0x3F) 10 } 11 12 func (s *bitset) isSet(val enumVal) bool { 13 return s[val>>6]&(1<<(val&0x3F)) > 0 14 } 15 16 func (s *bitset) String() string { 17 return fmt.Sprintf("%X %X %X %X", s[3], s[2], s[1], s[0]) 18 }