util.go 275 Bytes
Newer Older
ale's avatar
ale committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package server

// Returns the intersection of two string lists (in O(N^2) time).
func intersectGroups(a, b []string) []string {
	var out []string
	for _, aa := range a {
		for _, bb := range b {
			if aa == bb {
				out = append(out, aa)
				break
			}
		}
	}
	return out
}