[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
This commit is contained in:
Aiden Grossman 2026-02-07 09:30:20 -08:00 committed by GitHub
parent f72da50135
commit be4dbf5d64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<std::vector<uint8_t>> nopFiller = *ctx.target->nopInstrs;
unsigned num = size / nopFiller.back().size();
for (unsigned c = 0; c < num; ++c) {