Skip to content

Commit

Permalink
assingment in nil map
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatskaari committed Jan 20, 2025
1 parent ecb1d37 commit ad5165e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/core/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ func (graph *BuildGraph) PackageMap() map[string]*Package {
// NewGraph constructs and returns a new BuildGraph.
func NewGraph() *BuildGraph {
g := &BuildGraph{
targets: cmap.New[BuildLabel, *BuildTarget](cmap.DefaultShardCount, hashBuildLabel),
packages: cmap.New[packageKey, *Package](cmap.DefaultShardCount, hashPackageKey),
subrepos: cmap.New[string, *Subrepo](cmap.SmallShardCount, cmap.XXHash),
targets: cmap.New[BuildLabel, *BuildTarget](cmap.DefaultShardCount, hashBuildLabel),
packages: cmap.New[packageKey, *Package](cmap.DefaultShardCount, hashPackageKey),
subrepos: cmap.New[string, *Subrepo](cmap.SmallShardCount, cmap.XXHash),
subincludeSubincludes: map[BuildLabel][]BuildLabel{},
}
return g
}
Expand Down
4 changes: 1 addition & 3 deletions src/parse/asp/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,7 @@ func subincludeTarget(s *scope, l core.BuildLabel) *core.BuildTarget {
}

t := s.WaitForSubincludedTarget(l, pkgLabel)

// TODO(jpoole): when pkg is nil, that means this subinclude was made by another subinclude. We're currently loosing
// this information here. We probably need a way to transitively record the subincludes.

Check failure on line 408 in src/parse/asp/builtins.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/thought-machine/please) (gci)
if s.pkg != nil {
s.pkg.RegisterSubinclude(l)
} else {
Expand Down

0 comments on commit ad5165e

Please sign in to comment.