Skip to content

Commit 9447084

Browse files
committed
Simplified if construct
1 parent 0b9d7bd commit 9447084

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

legacy/builder/container_find_includes.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -344,14 +344,11 @@ func findIncludesUntilDone(ctx *types.Context, cache *includeCache, sourceFile *
344344
} else {
345345
preproc_stderr, preproc_err = GCCPreprocRunnerForDiscoveringIncludes(ctx, sourcePath, targetFilePath, includes)
346346
// Unwrap error and see if it is an ExitError.
347-
_, is_exit_error := errors.Cause(preproc_err).(*exec.ExitError)
348347
if preproc_err == nil {
349348
// Preprocessor successful, done
350349
include = ""
351-
} else if !is_exit_error || preproc_stderr == nil {
352-
// Ignore ExitErrors (e.g. gcc returning
353-
// non-zero status), but bail out on
354-
// other errors
350+
} else if _, isExitErr := errors.Cause(preproc_err).(*exec.ExitError); !isExitErr || preproc_stderr == nil {
351+
// Ignore ExitErrors (e.g. gcc returning non-zero status), but bail out on other errors
355352
return errors.WithStack(preproc_err)
356353
} else {
357354
include = IncludesFinderWithRegExp(string(preproc_stderr))

0 commit comments

Comments
 (0)