summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-02-13 13:00:49 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-02-13 13:00:49 -0800
commit5deabc3a24904e0af210b190b75528da8d5bdf29 (patch)
tree8260171ccdebdf9f1647a3b7d1c43da4f6fb24dd
parentcbf8ee89a8d292ec0b4ba5052bd58c13289abb4f (diff)
parent846761cd03e4d834cf4e62e8710e2d25f850a468 (diff)
Merge "Unique lists in ListSetDifference" into main
-rw-r--r--android/util.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/util.go b/android/util.go
index 2673a3a18..8591cc63e 100644
--- a/android/util.go
+++ b/android/util.go
@@ -213,10 +213,12 @@ func PrettyConcat(list []string, quote bool, lastSep string) string {
}
// 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
+// a boolean which is true if there is a difference, and then returns lists of unique 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
+ l1 = firstUnique(l1)
+ l2 = firstUnique(l2)
diff1 := []T{}
diff2 := []T{}
m1 := setFromList(l1)