MCPcopy Index your code
hub / github.com/coder/coder / Overlap

Function Overlap

coderd/util/slice/slice.go:124–128  ·  view source on GitHub ↗

Overlap returns if the 2 sets have any overlap (element(s) in common)

(a []T, b []T)

Source from the content-addressed store, hash-verified

122
123// Overlap returns if the 2 sets have any overlap (element(s) in common)
124func Overlap[T comparable](a []T, b []T) bool {
125 return OverlapCompare(a, b, func(a, b T) bool {
126 return a == b
127 })
128}
129
130func UniqueFunc[T any](a []T, equal func(a, b T) bool) []T {
131 cpy := make([]T, 0, len(a))

Callers 1

assertSetOverlapsFunction · 0.92

Calls 1

OverlapCompareFunction · 0.85

Tested by 1

assertSetOverlapsFunction · 0.74