<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Nov 20, 2014 at 1:19 PM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: kledzik<br>
Date: Thu Nov 20 15:19:58 2014<br>
New Revision: 222455<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=222455&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=222455&view=rev</a><br>
Log:<br>
[mach-o] use reference with "auto" to prevent copies<br>
<br>
Patch by Jean-Daniel Dupas<br>
<br>
Modified:<br>
lld/trunk/lib/ReaderWriter/MachO/File.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/MachO/File.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/File.h?rev=222455&r1=222454&r2=222455&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/File.h?rev=222455&r1=222454&r2=222455&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/MachO/File.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/MachO/File.h Thu Nov 20 15:19:58 2014<br>
@@ -118,13 +118,13 @@ public:<br>
MachODefinedAtom *findAtomCoveringAddress(const Section §ion,<br>
uint64_t offsetInSect,<br>
uint32_t *foundOffsetAtom=nullptr) {<br>
- auto pos = _sectionAtoms.find(§ion);<br>
+ const auto& pos = _sectionAtoms.find(§ion);<br>
if (pos == _sectionAtoms.end())<br>
return nullptr;<br>
- auto vec = pos->second;<br>
+ const auto& vec = pos->second;<br>
assert(offsetInSect < section.content.size());<br>
// Vector of atoms for section are already sorted, so do binary search.<br>
- auto atomPos = std::lower_bound(vec.begin(), vec.end(), offsetInSect,<br>
+ const auto& atomPos = std::lower_bound(vec.begin(), vec.end(), offsetInSect,<br></blockquote><div><br></div><div>This is really nit, but the standard style is not auto& foo but auto &foo.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[offsetInSect](const SectionOffsetAndAtom &ao,<br>
uint64_t targetAddr) -> bool {<br>
// Each atom has a start offset of its slice of the<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>