From 9e05a2d6d02c08c3f9f09fb53ce441600b739aec Mon Sep 17 00:00:00 2001 From: Eric Beckmann Date: Tue, 13 Jun 2017 21:05:42 +0000 Subject: [PATCH] Use reference to iterate through string table instead of copying. Summary: just a quick patch Subscribers: ruiu, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D34171 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305324 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/WindowsResource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Object/WindowsResource.cpp b/lib/Object/WindowsResource.cpp index a1a0d96acbc..3f6080d48f9 100644 --- a/lib/Object/WindowsResource.cpp +++ b/lib/Object/WindowsResource.cpp @@ -690,7 +690,7 @@ void WindowsResourceCOFFWriter::writeDirectoryTree() { void WindowsResourceCOFFWriter::writeDirectoryStringTable() { // Now write the directory string table for .rsrc$01 uint32_t TotalStringTableSize = 0; - for (auto String : StringTable) { + for (auto &String : StringTable) { uint16_t Length = String.size(); support::endian::write16le(BufferStart + CurrentOffset, Length); CurrentOffset += sizeof(uint16_t); -- 2.50.1