Skip to content

Commit c055ed1

Browse files
committed
Simplified if construct
1 parent 5e41df4 commit c055ed1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

legacy/builder/container_find_includes.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,11 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile *
364364
} else {
365365
preproc_stderr, preproc_err = GCCPreprocRunnerForDiscoveringIncludes(ctx, sourcePath, targetFilePath, includes)
366366
// Unwrap error and see if it is an ExitError.
367-
_, is_exit_error := errors.Cause(preproc_err).(*exec.ExitError)
368367
if preproc_err == nil {
369368
// Preprocessor successful, done
370369
include = ""
371-
} else if !is_exit_error || preproc_stderr == nil {
372-
// Ignore ExitErrors (e.g. gcc returning
373-
// non-zero status), but bail out on
374-
// other errors
370+
} else if _, isExitErr := errors.Cause(preproc_err).(*exec.ExitError); !isExitErr || preproc_stderr == nil {
371+
// Ignore ExitErrors (e.g. gcc returning non-zero status), but bail out on other errors
375372
return errors.WithStack(preproc_err)
376373
} else {
377374
include = IncludesFinderWithRegExp(string(preproc_stderr))

0 commit comments

Comments
 (0)