Skip to content

Commit 6525495

Browse files
committed
Removed local variable
1 parent 648a6b9 commit 6525495

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

legacy/builder/container_find_includes.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
342342
var include string
343343
f.cache.ExpectFile(sourcePath)
344344

345-
includes := f.ctx.IncludeFolders
346-
347345
var preprocErr error
348346
var preprocStderr []byte
349347
if unchanged && f.cache.valid {
@@ -352,7 +350,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
352350
f.ctx.Info(tr("Using cached library dependencies for file: %[1]s", sourcePath))
353351
}
354352
} else {
355-
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, includes)
353+
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, f.ctx.IncludeFolders)
356354
// Unwrap error and see if it is an ExitError.
357355
_, isExitError := errors.Cause(preprocErr).(*exec.ExitError)
358356
if preprocErr == nil {
@@ -384,7 +382,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
384382
// return errors.WithStack(err)
385383
if preprocErr == nil || preprocStderr == nil {
386384
// Filename came from cache, so run preprocessor to obtain error to show
387-
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, includes)
385+
preprocStderr, preprocErr = GCCPreprocRunnerForDiscoveringIncludes(f.ctx, sourcePath, targetFilePath, f.ctx.IncludeFolders)
388386
if preprocErr == nil {
389387
// If there is a missing #include in the cache, but running
390388
// gcc does not reproduce that, there is something wrong.
@@ -404,7 +402,7 @@ func (f *CppIncludesFinder) findIncludesUntilDone(sourceFile SourceFile) error {
404402
f.appendIncludeFolder(sourcePath, include, library.SourceDir)
405403
if library.UtilityDir != nil {
406404
// TODO: Use library.SourceDirs() instead?
407-
includes = append(includes, library.UtilityDir)
405+
f.ctx.IncludeFolders = append(f.ctx.IncludeFolders, library.UtilityDir)
408406
}
409407
sourceDirs := library.SourceDirs()
410408
for _, sourceDir := range sourceDirs {

0 commit comments

Comments
 (0)