forked from OSchip/llvm-project
[llvm-libtool-darwin] Use Optional operator overloads. NFC
Use operator bool instead of hasValue and operator* instead of getValue to simplify the code slightly.
This commit is contained in:
parent
160c133be5
commit
93c761f5e5
|
@ -108,10 +108,10 @@ static Expected<std::string> searchForFile(const Twine &FileName) {
|
|||
};
|
||||
|
||||
Optional<std::string> Found = FindLib(LibrarySearchDirs);
|
||||
if (!Found.hasValue())
|
||||
if (!Found)
|
||||
Found = FindLib(StandardSearchDirs);
|
||||
if (Found.hasValue())
|
||||
return Found.getValue();
|
||||
if (Found)
|
||||
return *Found;
|
||||
|
||||
return createStringError(std::errc::invalid_argument,
|
||||
"cannot locate file '%s'", FileName.str().c_str());
|
||||
|
|
Loading…
Reference in New Issue