@@ -272,7 +272,7 @@ func (l *SketchLibrariesDetector) findIncludes(
272272 // Pre-run cache entries
273273 l .preRunner = runner .New (ctx , jobs )
274274 for _ , entry := range l .cache .EntriesAhead () {
275- if entry .Compile != nil && entry . CompileTask != nil {
275+ if entry .CompileTask != nil {
276276 upToDate , _ := entry .Compile .ObjFileIsUpToDate ()
277277 if ! upToDate {
278278 _ = entry .Compile .PrepareBuildPath ()
@@ -351,7 +351,7 @@ func (l *SketchLibrariesDetector) findIncludes(
351351 return nil
352352}
353353
354- func (l * SketchLibrariesDetector ) gccPreprocessTask (sourceFile * sourceFile , buildProperties * properties.Map ) * runner.Task {
354+ func (l * SketchLibrariesDetector ) gccPreprocessTask (sourceFile sourceFile , buildProperties * properties.Map ) * runner.Task {
355355 // Libraries may require the "utility" directory to be added to the include
356356 // search path, but only for the source code of the library, so we temporary
357357 // copy the current search path list and add the library' utility directory
@@ -517,7 +517,7 @@ func (l *SketchLibrariesDetector) queueSourceFilesFromFolder(
517517
518518// makeSourceFile create a sourceFile object for the given source file path.
519519// The given sourceFilePath can be absolute, or relative within the sourceRoot root folder.
520- func (l * SketchLibrariesDetector ) makeSourceFile (sourceRoot , buildRoot , sourceFilePath * paths.Path , extraIncludePaths ... * paths.Path ) (* sourceFile , error ) {
520+ func (l * SketchLibrariesDetector ) makeSourceFile (sourceRoot , buildRoot , sourceFilePath * paths.Path , extraIncludePaths ... * paths.Path ) (sourceFile , error ) {
521521 if len (extraIncludePaths ) > 1 {
522522 panic ("only one extra include path allowed" )
523523 }
@@ -530,15 +530,14 @@ func (l *SketchLibrariesDetector) makeSourceFile(sourceRoot, buildRoot, sourceFi
530530 var err error
531531 sourceFilePath , err = sourceRoot .RelTo (sourceFilePath )
532532 if err != nil {
533- return nil , err
533+ return sourceFile {} , err
534534 }
535535 }
536- res := & sourceFile {
536+ return sourceFile {
537537 SourcePath : sourceRoot .JoinPath (sourceFilePath ),
538538 DepfilePath : buildRoot .Join (fmt .Sprintf ("%s.libsdetect.d" , sourceFilePath )),
539539 ExtraIncludePath : extraIncludePath ,
540- }
541- return res , nil
540+ }, nil
542541}
543542
544543func (l * SketchLibrariesDetector ) failIfImportedLibraryIsWrong () error {
0 commit comments