summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/util.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/android/util.go b/android/util.go
index 30d8ec6b3..b9ab77aec 100644
--- a/android/util.go
+++ b/android/util.go
@@ -238,8 +238,13 @@ func ListSetDifference[T comparable](l1, l2 []T) (bool, []T, []T) {
// Returns true if the two lists have common elements.
func HasIntersection[T comparable](l1, l2 []T) bool {
- _, a, b := ListSetDifference(l1, l2)
- return len(a)+len(b) < len(setFromList(l1))+len(setFromList(l2))
+ m1 := setFromList(l1)
+ for _, x := range l2 {
+ if _, ok := m1[x]; ok {
+ return true
+ }
+ }
+ return false
}
// Returns true if the given string s is prefixed with any string in the given prefix list.