[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:
Shoaib Meenai 2020-08-15 11:41:57 -07:00
parent 160c133be5
commit 93c761f5e5
1 changed files with 3 additions and 3 deletions

View File

@ -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());