Fix final nits from noticeindex change.

Test: m droid dist cts alllicensemetadata
Change-Id: Ie446e5693a09f4ae1c936cdae6f1e668105541f0
This commit is contained in:
Bob Badour
2022-11-02 10:24:04 -07:00
parent 88b02afbf0
commit 3afc3004f2
2 changed files with 5 additions and 7 deletions

View File

@@ -231,14 +231,12 @@ func (ni *NoticeIndex) Hashes() chan hash {
// InputFiles returns the complete list of files read during indexing.
func (ni *NoticeIndex) InputFiles() []string {
licenseMeta := []string(nil)
for f := range ni.lg.targets {
licenseMeta = append(licenseMeta, f)
}
projectMeta := ni.pmix.AllMetadataFiles()
files := make([]string, 0, len(ni.files) + len(licenseMeta) + len(projectMeta))
files := make([]string, 0, len(ni.files) + len(ni.lg.targets) + len(projectMeta))
files = append(files, ni.files...)
files = append(files, licenseMeta...)
for f := range ni.lg.targets {
files = append(files, f)
}
files = append(files, projectMeta...)
return files
}

View File

@@ -233,7 +233,7 @@ func (ix *Index) MetadataForProjects(projects ...string) ([]*ProjectMetadata, er
// AllMetadataFiles returns the sorted list of all METADATA files read thus far.
func (ix *Index) AllMetadataFiles() []string {
files := []string(nil)
var files []string
ix.projects.Range(func(key, value any) bool {
pi := value.(*projectIndex)
if pi.path != "" {