From: George Rimar Date: Mon, 29 Apr 2019 12:05:53 +0000 (+0000) Subject: [yaml2obj] - Replace a loop with write_zeros(). NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d44c8826a75e65b29fba46c480d65266621f2a4;p=llvm [yaml2obj] - Replace a loop with write_zeros(). NFCI. This looks better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359444 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index e3246bc2941..ba07c9c100c 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -40,8 +40,7 @@ class ContiguousBlobAccumulator { Align = 1; uint64_t CurrentOffset = InitialOffset + OS.tell(); uint64_t AlignedOffset = alignTo(CurrentOffset, Align); - for (; CurrentOffset != AlignedOffset; ++CurrentOffset) - OS.write('\0'); + OS.write_zeros(AlignedOffset - CurrentOffset); return AlignedOffset; // == CurrentOffset; }