(mask byte)
| 7 | ) |
| 8 | |
| 9 | func UniqueBitmaskToStates(mask byte) []rivertype.JobState { |
| 10 | var states []rivertype.JobState |
| 11 | |
| 12 | for state, bitIndex := range jobStateBitPositions { |
| 13 | bitPosition := 7 - (bitIndex % 8) |
| 14 | if mask&(1<<bitPosition) != 0 { |
| 15 | states = append(states, state) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | slices.Sort(states) |
| 20 | return states |
| 21 | } |
| 22 | |
| 23 | var jobStateBitPositions = map[rivertype.JobState]uint{ //nolint:gochecknoglobals |
| 24 | rivertype.JobStateAvailable: 7, |
no outgoing calls
no test coverage detected
searching dependent graphs…