mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #115922 from sourcelliu/impovevolume
Improve performance of method haveOverlap
This commit is contained in:
commit
4dfd2fe74d
@ -144,11 +144,7 @@ func haveOverlap(a1, a2 []string) bool {
|
|||||||
if len(a1) > len(a2) {
|
if len(a1) > len(a2) {
|
||||||
a1, a2 = a2, a1
|
a1, a2 = a2, a1
|
||||||
}
|
}
|
||||||
m := make(sets.String)
|
m := sets.New(a1...)
|
||||||
|
|
||||||
for _, val := range a1 {
|
|
||||||
m.Insert(val)
|
|
||||||
}
|
|
||||||
for _, val := range a2 {
|
for _, val := range a2 {
|
||||||
if _, ok := m[val]; ok {
|
if _, ok := m[val]; ok {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user