From be4dbf5d6459235ddad578efe74163aa88e4be91 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sat, 7 Feb 2026 09:30:20 -0800 Subject: [PATCH] [lld][ELF] Remove redundant size check in nopInstrFill We checked twice of size is equal to zero. This is not necessary and makes the code a little bit less readable. Reviewers: MaskRay, tmsri Pull Request: https://github.com/llvm/llvm-project/pull/180304 --- lld/ELF/OutputSections.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index c9c63b3620b1..1522e608563a 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -303,8 +303,6 @@ static void nopInstrFill(Ctx &ctx, uint8_t *buf, size_t size) { if (size == 0) return; unsigned i = 0; - if (size == 0) - return; std::vector> nopFiller = *ctx.target->nopInstrs; unsigned num = size / nopFiller.back().size(); for (unsigned c = 0; c < num; ++c) {