android: Use slices.DeleteFunc for filtering
Clean-up two filters in arch.go by using slices.DeleteFunc Bug: 353739440 Test: m blueprint_tests Change-Id: I3738bb7961830e2c287257cceb64194f048514d3
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/google/blueprint"
|
||||
@@ -592,26 +593,16 @@ func archMutator(bpctx blueprint.BottomUpMutatorContext) {
|
||||
// Filter NativeBridge targets unless they are explicitly supported.
|
||||
// Skip creating native bridge variants for non-core modules.
|
||||
if os == Android && !(base.IsNativeBridgeSupported() && image == CoreVariation) {
|
||||
|
||||
var targets []Target
|
||||
for _, t := range osTargets {
|
||||
if !t.NativeBridge {
|
||||
targets = append(targets, t)
|
||||
}
|
||||
}
|
||||
|
||||
osTargets = targets
|
||||
osTargets = slices.DeleteFunc(slices.Clone(osTargets), func(t Target) bool {
|
||||
return bool(t.NativeBridge)
|
||||
})
|
||||
}
|
||||
|
||||
// Filter HostCross targets if disabled.
|
||||
if base.HostSupported() && !base.HostCrossSupported() {
|
||||
var targets []Target
|
||||
for _, t := range osTargets {
|
||||
if !t.HostCross {
|
||||
targets = append(targets, t)
|
||||
}
|
||||
}
|
||||
osTargets = targets
|
||||
osTargets = slices.DeleteFunc(slices.Clone(osTargets), func(t Target) bool {
|
||||
return t.HostCross
|
||||
})
|
||||
}
|
||||
|
||||
// only the primary arch in the ramdisk / vendor_ramdisk / recovery partition
|
||||
|
Reference in New Issue
Block a user