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

Commit 461b445d authored by Colin Cross's avatar Colin Cross
Browse files

Pass nil instead of []string{} to ctx.Glob* functions

[]string{} is unnecessary, just use nil.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Ia9aeb2ffc483429787da0e473a7f1bc87eb4cad1
parent 0c18d451
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1177,7 +1177,10 @@ func (ctx *androidModuleContext) ExpandOptionalSource(srcFile *string, prop stri
func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths {
	prefix := PathForModuleSrc(ctx).String()

	expandedExcludes := make([]string, 0, len(excludes))
	var expandedExcludes []string
	if excludes != nil {
		expandedExcludes = make([]string, 0, len(excludes))
	}

	for _, e := range excludes {
		if m := SrcIsModule(e); m != "" {
+2 −2
Original line number Diff line number Diff line
@@ -269,7 +269,7 @@ func PathsWithOptionalDefaultForModuleSrc(ctx ModuleContext, input []string, def
	// Use Glob so that if the default doesn't exist, a dependency is added so that when it
	// is created, we're run again.
	path := filepath.Join(ctx.Config().srcDir, ctx.ModuleDir(), def)
	return ctx.Glob(path, []string{})
	return ctx.Glob(path, nil)
}

// Strings returns the Paths in string form
@@ -635,7 +635,7 @@ func (p SourcePath) OverlayPath(ctx ModuleContext, path Path) OptionalPath {
	if pathtools.IsGlob(dir) {
		reportPathErrorf(ctx, "Path may not contain a glob: %s", dir)
	}
	paths, err := ctx.GlobWithDeps(dir, []string{})
	paths, err := ctx.GlobWithDeps(dir, nil)
	if err != nil {
		reportPathErrorf(ctx, "glob: %s", err.Error())
		return OptionalPath{}