Improve performance of method haveOverlap

Signed-off-by: mantuliu <240951888@qq.com>
This commit is contained in:
mantuliu 2023-02-22 00:51:55 +08:00
parent af85f410a2
commit edc0455c5c

View File

@ -144,7 +144,7 @@ func haveOverlap(a1, a2 []string) bool {
if len(a1) > len(a2) {
a1, a2 = a2, a1
}
m := sets.New[string](a1...)
m := sets.New(a1...)
for _, val := range a2 {
if _, ok := m[val]; ok {
return true