MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / StateExists

Function StateExists

strings/ahocorasick/shared.go:133–139  ·  view source on GitHub ↗

StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise.

(state int, at map[int]map[uint8]int)

Source from the content-addressed store, hash-verified

131
132// StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise.
133func StateExists(state int, at map[int]map[uint8]int) bool {
134 _, ok := at[state]
135 if !ok || state == -1 || at[state] == nil {
136 return false
137 }
138 return true
139}

Callers 3

BuildAcFunction · 0.85
BuildExtendedAcFunction · 0.85
GetTransitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected