Skip to content

Commit 224f05f

Browse files
committed
Removed local variable
1 parent 055e396 commit 224f05f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

legacy/builder/container_find_includes.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
331331
var include string
332332
f.cache.ExpectFile(sourcePath)
333333

334-
includes := f.ctx.IncludeFolders
335334
var preprocErr error
336335
var preprocStderr []byte
337336
if unchanged && f.cache.valid {
@@ -340,7 +339,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
340339
f.ctx.GetLogger().Println(constants.LOG_LEVEL_INFO, constants.MSG_USING_CACHED_INCLUDES, sourcePath)
341340
}
342341
} else {
343-
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, includes)
342+
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, f.ctx.IncludeFolders)
344343
// Unwrap error and see if it is an ExitError.
345344
_, isExitError := errors.Cause(preprocErr).(*exec.ExitError)
346345
if preprocErr == nil {
@@ -372,7 +371,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
372371
// return errors.WithStack(err)
373372
if preprocErr == nil || preprocStderr == nil {
374373
// Filename came from cache, so run preprocessor to obtain error to show
375-
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, includes)
374+
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, f.ctx.IncludeFolders)
376375
if preprocErr == nil {
377376
// If there is a missing #include in the cache, but running
378377
// gcc does not reproduce that, there is something wrong.
@@ -392,7 +391,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
392391
f.appendIncludeFolder(sourcePath, include, library.SourceDir)
393392
if library.UtilityDir != nil {
394393
// TODO: Use library.SourceDirs() instead?
395-
includes = append(includes, library.UtilityDir)
394+
f.ctx.IncludeFolders = append(f.ctx.IncludeFolders, library.UtilityDir)
396395
}
397396
sourceDirs := library.SourceDirs()
398397
for _, sourceDir := range sourceDirs {

0 commit comments

Comments
 (0)