Skip to content

Commit 327db23

Browse files
committed
[Object] isNotObjectErrorInvalidFileType: simplify
llvm-svn: 365997
1 parent 16ac7a5 commit 327db23

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

llvm/lib/Object/Error.cpp

+10-13
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,15 @@ const std::error_category &object::object_category() {
7878
}
7979

8080
llvm::Error llvm::object::isNotObjectErrorInvalidFileType(llvm::Error Err) {
81-
if (auto Err2 =
82-
handleErrors(std::move(Err), [](std::unique_ptr<ECError> M) -> Error {
83-
// Try to handle 'M'. If successful, return a success value from
84-
// the handler.
85-
if (M->convertToErrorCode() == object_error::invalid_file_type)
86-
return Error::success();
81+
return handleErrors(std::move(Err), [](std::unique_ptr<ECError> M) -> Error {
82+
// Try to handle 'M'. If successful, return a success value from
83+
// the handler.
84+
if (M->convertToErrorCode() == object_error::invalid_file_type)
85+
return Error::success();
8786

88-
// We failed to handle 'M' - return it from the handler.
89-
// This value will be passed back from catchErrors and
90-
// wind up in Err2, where it will be returned from this function.
91-
return Error(std::move(M));
92-
}))
93-
return Err2;
94-
return Error::success();
87+
// We failed to handle 'M' - return it from the handler.
88+
// This value will be passed back from catchErrors and
89+
// wind up in Err2, where it will be returned from this function.
90+
return Error(std::move(M));
91+
});
9592
}

0 commit comments

Comments
 (0)