Skip to content

Commit ad00959

Browse files
committed
[lld][NFC] Remove unnecessary else statements.
1 parent 1c27899 commit ad00959

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

lld/COFF/Chunks.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,13 @@ class SectionChunk final : public Chunk {
386386
inline size_t Chunk::getSize() const {
387387
if (isa<SectionChunk>(this))
388388
return static_cast<const SectionChunk *>(this)->getSize();
389-
else
390-
return static_cast<const NonSectionChunk *>(this)->getSize();
389+
return static_cast<const NonSectionChunk *>(this)->getSize();
391390
}
392391

393392
inline uint32_t Chunk::getOutputCharacteristics() const {
394393
if (isa<SectionChunk>(this))
395394
return static_cast<const SectionChunk *>(this)->getOutputCharacteristics();
396-
else
397-
return static_cast<const NonSectionChunk *>(this)
398-
->getOutputCharacteristics();
395+
return static_cast<const NonSectionChunk *>(this)->getOutputCharacteristics();
399396
}
400397

401398
inline void Chunk::writeTo(uint8_t *buf) const {
@@ -408,8 +405,7 @@ inline void Chunk::writeTo(uint8_t *buf) const {
408405
inline StringRef Chunk::getSectionName() const {
409406
if (isa<SectionChunk>(this))
410407
return static_cast<const SectionChunk *>(this)->getSectionName();
411-
else
412-
return static_cast<const NonSectionChunk *>(this)->getSectionName();
408+
return static_cast<const NonSectionChunk *>(this)->getSectionName();
413409
}
414410

415411
inline void Chunk::getBaserels(std::vector<Baserel> *res) {
@@ -422,15 +418,13 @@ inline void Chunk::getBaserels(std::vector<Baserel> *res) {
422418
inline StringRef Chunk::getDebugName() const {
423419
if (isa<SectionChunk>(this))
424420
return static_cast<const SectionChunk *>(this)->getDebugName();
425-
else
426-
return static_cast<const NonSectionChunk *>(this)->getDebugName();
421+
return static_cast<const NonSectionChunk *>(this)->getDebugName();
427422
}
428423

429424
inline MachineTypes Chunk::getMachine() const {
430425
if (isa<SectionChunk>(this))
431426
return static_cast<const SectionChunk *>(this)->getMachine();
432-
else
433-
return static_cast<const NonSectionChunk *>(this)->getMachine();
427+
return static_cast<const NonSectionChunk *>(this)->getMachine();
434428
}
435429

436430
inline chpe_range_type Chunk::getArm64ECRangeType() const {

0 commit comments

Comments
 (0)