Skip to content

Commit adc8cf9

Browse files
Remove done variable from findIncludesUntilDone
This prepares for a change in the next commit. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
1 parent 0298939 commit adc8cf9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/arduino.cc/builder/container_find_includes.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ func runCommand(ctx *types.Context, command types.Command) error {
8585
func findIncludesUntilDone(ctx *types.Context, sourceFilePath string) error {
8686
targetFilePath := utils.NULLFile()
8787
importedLibraries := ctx.ImportedLibraries
88-
done := false
89-
for !done {
88+
for {
9089
commands := []types.Command{
9190
&GCCPreprocRunnerForDiscoveringIncludes{SourceFilePath: sourceFilePath, TargetFilePath: targetFilePath},
9291
&IncludesFinderWithRegExp{Source: &ctx.SourceGccMinusE},
@@ -99,12 +98,14 @@ func findIncludesUntilDone(ctx *types.Context, sourceFilePath string) error {
9998
}
10099
}
101100
if ctx.IncludeJustFound == "" {
102-
done = true
103-
} else if len(ctx.ImportedLibraries) == len(importedLibraries) {
101+
// No missing includes found, we're done
102+
return nil
103+
}
104+
105+
if len(ctx.ImportedLibraries) == len(importedLibraries) {
104106
err := runCommand(ctx, &GCCPreprocRunner{TargetFileName: constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E})
105107
return i18n.WrapError(err)
106108
}
107109
importedLibraries = ctx.ImportedLibraries
108110
}
109-
return nil
110111
}

0 commit comments

Comments
 (0)