projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
160c133
)
[llvm-libtool-darwin] Use Optional operator overloads. NFC
author
Shoaib Meenai
<smeenai@fb.com>
Sat, 15 Aug 2020 18:41:57 +0000
(11:41 -0700)
committer
Shoaib Meenai
<smeenai@fb.com>
Sat, 15 Aug 2020 18:41:57 +0000
(11:41 -0700)
Use operator bool instead of hasValue and operator* instead of getValue
to simplify the code slightly.
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
patch
|
blob
|
history
diff --git
a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
index
a91f783
..
e861b46
100644
(file)
--- a/
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ b/
llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@
-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());