summaryrefslogtreecommitdiff
path: root/android/depset_generic.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-06-29 18:46:20 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-06-29 18:46:20 +0000
commitda169a1ee35f00a164843ffecdfc632b3ba96d87 (patch)
treed89a4ac902648309f43be7f2eeaabd00bd3310e5 /android/depset_generic.go
parent187aa2905643881a5cbca62b9389306741a55cfd (diff)
parent48016d5a2f3d0a518de795e4eba6d899628a86bb (diff)
Merge "Fix FirstUniqueStrings after conversion to generics"
Diffstat (limited to 'android/depset_generic.go')
-rw-r--r--android/depset_generic.go12
1 files changed, 1 insertions, 11 deletions
diff --git a/android/depset_generic.go b/android/depset_generic.go
index ae14d3271..4f31b8697 100644
--- a/android/depset_generic.go
+++ b/android/depset_generic.go
@@ -175,16 +175,6 @@ func (d *DepSet[T]) walk(visit func([]T)) {
// its transitive dependencies, in which case the ordering of the duplicated element is not
// guaranteed).
func (d *DepSet[T]) ToList() []T {
- return d.toList(firstUnique[T])
-}
-
-// toList returns the DepSet flattened to a list. The order in the list is based on the order
-// of the DepSet. POSTORDER and PREORDER orders return a postordered or preordered left to right
-// flattened list. TOPOLOGICAL returns a list that guarantees that elements of children are listed
-// after all of their parents (unless there are duplicate direct elements in the DepSet or any of
-// its transitive dependencies, in which case the ordering of the duplicated element is not
-// guaranteed). The firstUniqueFunc is used to remove duplicates from the list.
-func (d *DepSet[T]) toList(firstUniqueFunc func([]T) []T) []T {
if d == nil {
return nil
}
@@ -192,7 +182,7 @@ func (d *DepSet[T]) toList(firstUniqueFunc func([]T) []T) []T {
d.walk(func(paths []T) {
list = append(list, paths...)
})
- list = firstUniqueFunc(list)
+ list = firstUniqueInPlace(list)
if d.reverse {
reverseSliceInPlace(list)
}