summaryrefslogtreecommitdiff
path: root/android/util.go
diff options
context:
space:
mode:
author Wen-yi Chu <wenyichu@google.com> 2023-09-22 03:58:59 +0000
committer Wen-yi Chu <wenyichu@google.com> 2023-09-22 22:05:54 +0000
commit41326c1f410bafb909a56f1cf7ca8748ce06cab3 (patch)
tree0d630e655cf5311ccc525173d4d56fc75c8cee42 /android/util.go
parentdf0ed707a5bdbe0e3d20afe9f81acb09e2e887be (diff)
Revert "support sandboxed rust rules"
Revert submission 2629131-sandbox-rust-inputs Reason for revert: Fail on android build. Reverted changes: /q/submissionid:2629131-sandbox-rust-inputs Change-Id: Ifd9aa46e80a12d8f4ffa0a2daa74b96727cbb7e6
Diffstat (limited to 'android/util.go')
-rw-r--r--android/util.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/android/util.go b/android/util.go
index 7f6af2d68..5375373a6 100644
--- a/android/util.go
+++ b/android/util.go
@@ -33,17 +33,12 @@ func CopyOf[T any](s []T) []T {
return append([]T{}, s...)
}
-// Concat returns a new slice concatenated from the input slices. It does not change the input
+// Concat returns a new slice concatenated from the two input slices. It does not change the input
// slices.
-func Concat[T any](slices ...[]T) []T {
- newLength := 0
- for _, s := range slices {
- newLength += len(s)
- }
- res := make([]T, 0, newLength)
- for _, s := range slices {
- res = append(res, s...)
- }
+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
}