Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38788dce authored by Paul Duffin's avatar Paul Duffin Committed by Gerrit Code Review
Browse files

Merge "Remove unnecessary handling of nil paths in HiddenAPIOutput"

parents 880a3971 ed12c132
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -83,22 +83,11 @@ func newMonolithicHiddenAPIInfo(ctx android.ModuleContext, flagFilesByCategory F
// append appends all the files from the supplied info to the corresponding files in this struct.
func (i *MonolithicHiddenAPIInfo) append(other *HiddenAPIInfo) {
	i.FlagsFilesByCategory.append(other.FlagFilesByCategory)

	// The output may not be set if the bootclasspath_fragment has not yet been updated to support
	// hidden API processing.
	// TODO(b/179354495): Switch back to append once all bootclasspath_fragment modules have been
	//  updated to support hidden API processing properly.
	appendIfNotNil := func(paths android.Paths, path android.Path) android.Paths {
		if path == nil {
			return paths
		}
		return append(paths, path)
	}
	i.StubFlagsPaths = appendIfNotNil(i.StubFlagsPaths, other.StubFlagsPath)
	i.AnnotationFlagsPaths = appendIfNotNil(i.AnnotationFlagsPaths, other.AnnotationFlagsPath)
	i.MetadataPaths = appendIfNotNil(i.MetadataPaths, other.MetadataPath)
	i.IndexPaths = appendIfNotNil(i.IndexPaths, other.IndexPath)
	i.AllFlagsPaths = appendIfNotNil(i.AllFlagsPaths, other.AllFlagsPath)
	i.StubFlagsPaths = append(i.StubFlagsPaths, other.StubFlagsPath)
	i.AnnotationFlagsPaths = append(i.AnnotationFlagsPaths, other.AnnotationFlagsPath)
	i.MetadataPaths = append(i.MetadataPaths, other.MetadataPath)
	i.IndexPaths = append(i.IndexPaths, other.IndexPath)
	i.AllFlagsPaths = append(i.AllFlagsPaths, other.AllFlagsPath)
}

// dedup removes duplicates in all the paths, while maintaining the order in which they were