diff options
author | 2021-07-14 16:35:33 +0100 | |
---|---|---|
committer | 2021-07-15 08:30:27 +0100 | |
commit | 497a09310b03ce1cde15895423dcc71e8b9de9ee (patch) | |
tree | e8ec693eadff3cf324f9edcd9cf9d5d70f096893 /java/java.go | |
parent | 39924233e0679fa072366570774b16b8242b4c43 (diff) |
Drop `strings.HasPrefix` when guarding `strings.TrimPrefix`.
There is no need to check as `TrimPrefix` does nothing if the prefix
doesn't match (see https://pkg.go.dev/strings#TrimPrefix).
Bug: 193425964
Test: m nothing
Change-Id: Ieb82e72a471800e29eb6bb54308041a9ab4173e5
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/java/java.go b/java/java.go index be1ad874f..0770f7ffb 100644 --- a/java/java.go +++ b/java/java.go @@ -21,7 +21,6 @@ package java import ( "fmt" "path/filepath" - "strings" "github.com/google/blueprint" "github.com/google/blueprint/proptools" @@ -1462,11 +1461,7 @@ func (j *Import) IDECustomizedModuleName() string { // TODO(b/113562217): Extract the base module name from the Import name, often the Import name // has a prefix "prebuilt_". Remove the prefix explicitly if needed until we find a better // solution to get the Import name. - name := j.Name() - if strings.HasPrefix(name, removedPrefix) { - name = strings.TrimPrefix(name, removedPrefix) - } - return name + return android.RemoveOptionalPrebuiltPrefix(j.Name()) } var _ android.PrebuiltInterface = (*Import)(nil) |