From cfa171d68c8e22f0c789639a6760e578ba774759 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 25 Oct 2017 18:09:54 +0000 Subject: [PATCH] Simplify. ArrayRef() equals to ArrayRef(nullptr, 0), so it looks like we don't need to handle size 0 as a special case. llvm-svn: 316600 --- lld/ELF/InputSection.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 56b68da..7c3e2eb 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -824,14 +824,10 @@ template void EhInputSection::split() { if (!this->Pieces.empty()) return; - if (this->NumRelocations) { - if (this->AreRelocsRela) - split(this->relas()); - else - split(this->rels()); - return; - } - split(makeArrayRef(nullptr, nullptr)); + if (this->AreRelocsRela) + split(this->relas()); + else + split(this->rels()); } template -- 2.7.4