[PATCH] D77674: [WebAssembly][MC] Use StringRef over std::string pointer
Brian Cain via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 07:01:43 PDT 2020
bcain added inline comments.
================
Comment at: llvm/include/llvm/MC/MCSymbolWasm.h:86
StringRef getImportName() const {
- if (ImportName)
- return StringRef(*ImportName);
+ if (ImportName.hasValue())
+ return ImportName.getValue();
----------------
This block could instead be written as `return ImportName.getValueOr(getName());`
[not that you need to revisit the code, just a suggestion for next time]
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77674/new/
https://reviews.llvm.org/D77674
More information about the llvm-commits
mailing list