Skip to content

Commit 85de69a

Browse files
Remove unneeded code from ContainerFindIncludes
The removed code iterates over the detected libraries and adds their source directories to the queue for running further detection on them. However, IncludesToIncludeFolders (called by findIncludesUntilDone(), which is called a bit above the removed code) already does this, so there is no need to do it again. Since Ctx.FoldersWithSources is a UniqueStringQueue, this unneeded code was not affecting behaviour in any way. It seems likely that this code had a purpose previously, but it was lost in some refactor. However, a quick scan of the commit that introduced it (d6e378: Implemented library to library dependency full discovery) suggests that this code was useless from the start. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
1 parent c788448 commit 85de69a

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/arduino.cc/builder/container_find_includes.go

-8
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ func (s *ContainerFindIncludes) Run(ctx *types.Context) error {
6060
if info, err := os.Stat(srcSubfolderPath); err == nil && info.IsDir() {
6161
foldersWithSources.Push(types.SourceFolder{Folder: srcSubfolderPath, Recurse: true})
6262
}
63-
if len(ctx.ImportedLibraries) > 0 {
64-
for _, library := range ctx.ImportedLibraries {
65-
sourceFolders := types.LibraryToSourceFolder(library)
66-
for _, sourceFolder := range sourceFolders {
67-
foldersWithSources.Push(sourceFolder)
68-
}
69-
}
70-
}
7163

7264
err = runCommand(ctx, &CollectAllSourceFilesFromFoldersWithSources{})
7365
if err != nil {

0 commit comments

Comments
 (0)