MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SliceContains

Function SliceContains

pkg/utils/slice.go:23–30  ·  view source on GitHub ↗

SliceContains check if slice contains element

(arr []T, v T)

Source from the content-addressed store, hash-verified

21
22// SliceContains check if slice contains element
23func SliceContains[T comparable](arr []T, v T) bool {
24 for _, vv := range arr {
25 if vv == v {
26 return true
27 }
28 }
29 return false
30}
31
32// SliceAllContains check if slice all contains elements
33func SliceAllContains[T comparable](arr []T, vs ...T) bool {

Callers 15

InitMethod · 0.92
requestReturnErrRespMethod · 0.92
LinkMethod · 0.92
requestMethod · 0.92
getClientMethod · 0.92
InitMethod · 0.92
PutMethod · 0.92
requestMethod · 0.92
RemoveMethod · 0.92
RemoveByStatesMethod · 0.92
GetByStatesMethod · 0.92
updateIgnorePathsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected