[llvm] r305324 - Use reference to iterate through string table instead of copying.

Eric Beckmann via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 14:05:42 PDT 2017


Author: ecbeckmann
Date: Tue Jun 13 16:05:42 2017
New Revision: 305324

URL: http://llvm.org/viewvc/llvm-project?rev=305324&view=rev
Log:
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

Modified:
    llvm/trunk/lib/Object/WindowsResource.cpp

Modified: llvm/trunk/lib/Object/WindowsResource.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/WindowsResource.cpp?rev=305324&r1=305323&r2=305324&view=diff
==============================================================================
--- llvm/trunk/lib/Object/WindowsResource.cpp (original)
+++ llvm/trunk/lib/Object/WindowsResource.cpp Tue Jun 13 16:05:42 2017
@@ -690,7 +690,7 @@ void WindowsResourceCOFFWriter::writeDir
 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);




More information about the llvm-commits mailing list