From 8620bb9534342176ac739e2a587e4cecf437310c Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 16 Mar 2020 22:51:48 -0700 Subject: [PATCH] [lld] Fix "loop variable creates a copy" warning --- lld/COFF/Writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp index bb583757cb61..7e7aaafe18ed 100644 --- a/lld/COFF/Writer.cpp +++ b/lld/COFF/Writer.cpp @@ -102,7 +102,7 @@ public: void writeTo(uint8_t *b) const override { auto *d = reinterpret_cast(b); - for (const std::pair record : records) { + for (const std::pair& record : records) { Chunk *c = record.second; OutputSection *os = c->getOutputSection(); uint64_t offs = os->getFileOff() + (c->getRVA() - os->getRVA());