summaryrefslogtreecommitdiff
path: root/android/util.go
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2023-02-23 17:37:16 +0000
committer Jiakai Zhang <jiakaiz@google.com> 2023-02-24 17:13:54 +0000
commit8fe3a415b5620ea7e0edd83a031ebaedbe570d90 (patch)
treecb74137a1325ff58cbb92aa02de37b81c6d59dbe /android/util.go
parent5fba88bbd6fa8edc97dada1910db3d1eb35005a8 (diff)
Refactor dexpreopt for boot jars to allow more complex dependencies.
After this change, the dependency hierachy can be arbitrarily deep. For example, you can have one boot image that extends another boot image that extends yet another boot image. Bug: 269230245 Test: m Change-Id: I096d0b57bda36b982ecc97378647f9c59071a3bf
Diffstat (limited to 'android/util.go')
-rw-r--r--android/util.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/android/util.go b/android/util.go
index 947af699c..8f4c17daa 100644
--- a/android/util.go
+++ b/android/util.go
@@ -29,6 +29,15 @@ func CopyOf(s []string) []string {
return append([]string(nil), s...)
}
+// Concat returns a new slice concatenated from the two input slices. It does not change the input
+// slices.
+func Concat[T any](s1, s2 []T) []T {
+ res := make([]T, 0, len(s1)+len(s2))
+ res = append(res, s1...)
+ res = append(res, s2...)
+ return res
+}
+
// JoinWithPrefix prepends the prefix to each string in the list and
// returns them joined together with " " as separator.
func JoinWithPrefix(strs []string, prefix string) string {