From 4a2dc8f0829c15ab38db6c810e475936b07c1fa8 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 3 Oct 2015 00:57:12 +0000 Subject: [PATCH] Use early return. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249224 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCObjectStreamer.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 489ab06c268..caee5da47a0 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -39,19 +39,19 @@ MCObjectStreamer::~MCObjectStreamer() { } void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) { - if (PendingLabels.size()) { - if (!F) { - F = new MCDataFragment(); - MCSection *CurSection = getCurrentSectionOnly(); - CurSection->getFragmentList().insert(CurInsertionPoint, F); - F->setParent(CurSection); - } - for (MCSymbol *Sym : PendingLabels) { - Sym->setFragment(F); - Sym->setOffset(FOffset); - } - PendingLabels.clear(); + if (PendingLabels.empty()) + return; + if (!F) { + F = new MCDataFragment(); + MCSection *CurSection = getCurrentSectionOnly(); + CurSection->getFragmentList().insert(CurInsertionPoint, F); + F->setParent(CurSection); } + for (MCSymbol *Sym : PendingLabels) { + Sym->setFragment(F); + Sym->setOffset(FOffset); + } + PendingLabels.clear(); } void MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, -- 2.11.0