clean up CL for androidmk variables
Change-Id: If14d1925bea78f467740f8395f1d529db00b618c
diff --git a/android/util.go b/android/util.go
index 234bda3..947af69 100644
--- a/android/util.go
+++ b/android/util.go
@@ -144,22 +144,28 @@
return m
}
-// ListDifference checks if the two lists contain the same elements
-func ListDifference[T comparable](l1, l2 []T) []T {
- diff := []T{}
+// ListSetDifference checks if the two lists contain the same elements. It returns
+// a boolean which is true if there is a difference, and then returns lists of elements
+// that are in l1 but not l2, and l2 but not l1.
+func ListSetDifference[T comparable](l1, l2 []T) (bool, []T, []T) {
+ listsDiffer := false
+ diff1 := []T{}
+ diff2 := []T{}
m1 := setFromList(l1)
m2 := setFromList(l2)
- for _, t := range l1 {
+ for t := range m1 {
if _, ok := m2[t]; !ok {
- diff = append(diff, t)
+ diff1 = append(diff1, t)
+ listsDiffer = true
}
}
- for _, t := range l2 {
+ for t := range m2 {
if _, ok := m1[t]; !ok {
- diff = append(diff, t)
+ diff2 = append(diff2, t)
+ listsDiffer = true
}
}
- return diff
+ return listsDiffer, diff1, diff2
}
// Returns true if the given string s is prefixed with any string in the given prefix list.