Set sets a BooleanSet value.
(flag T, enabled bool, bs *BooleanSet)
| 74 | |
| 75 | // Set sets a BooleanSet value. |
| 76 | func Set[T constraints.Integer](flag T, enabled bool, bs *BooleanSet) { |
| 77 | if len(*bs) < int(flag/8)+1 { |
| 78 | *bs = append(*bs, make([]byte, int(flag/8)+1-len(*bs))...) |
| 79 | } |
| 80 | |
| 81 | if enabled { |
| 82 | (*bs)[flag/8] |= 1 << uint(flag%8) |
| 83 | } else { |
| 84 | (*bs)[flag/8] &= ^(1 << uint(flag%8)) |
| 85 | } |
| 86 | } |
no outgoing calls