[wasm] Simplify. NFC

llvm-svn: 358663
This commit is contained in:
Fangrui Song 2019-04-18 13:33:29 +00:00
parent 4cfc8d6afc
commit 196a440411
3 changed files with 4 additions and 4 deletions

View File

@ -491,7 +491,7 @@ bool SymbolTable::getFunctionVariant(Symbol* Sym, const WasmSignature *Sig,
// Linear search through symbol variants. Should never be more than two
// or three entries here.
auto &Variants = SymVariants[CachedHashStringRef(Sym->getName())];
if (Variants.size() == 0)
if (Variants.empty())
Variants.push_back(Sym);
for (Symbol* V : Variants) {

View File

@ -718,12 +718,12 @@ void Writer::createProducersSection() {
}
void Writer::createTargetFeaturesSection() {
if (TargetFeatures.size() == 0)
if (TargetFeatures.empty())
return;
SmallVector<std::string, 8> Emitted(TargetFeatures.begin(),
TargetFeatures.end());
std::sort(Emitted.begin(), Emitted.end());
llvm::sort(Emitted);
SyntheticSection *Section =
createSyntheticSection(WASM_SEC_CUSTOM, "target_features");
auto &OS = Section->getStream();

View File

@ -196,7 +196,7 @@ std::string lld::toString(const WasmSignature &Sig) {
S += toString(Type);
}
S += ") -> ";
if (Sig.Returns.size() == 0)
if (Sig.Returns.empty())
S += "void";
else
S += toString(Sig.Returns[0]);