MCPcopy Index your code
hub / github.com/riverqueue/river / UniqueBitmaskToStates

Function UniqueBitmaskToStates

rivershared/uniquestates/unique_states.go:9–21  ·  view source on GitHub ↗
(mask byte)

Source from the content-addressed store, hash-verified

7)
8
9func 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
23var jobStateBitPositions = map[rivertype.JobState]uint{ //nolint:gochecknoglobals
24 rivertype.JobStateAvailable: 7,

Callers 3

jobRowFromInternalFunction · 0.92
jobRowFromInternalFunction · 0.92
jobRowFromInternalFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…