diff options
author | Nick Kledzik <kledzik@apple.com> | 2014-11-20 21:19:58 +0000 |
---|---|---|
committer | Nick Kledzik <kledzik@apple.com> | 2014-11-20 21:19:58 +0000 |
commit | 9d98f7e454d928b97958e994060d8f6dcf0ac9c3 (patch) | |
tree | 49fccbb0069a43a0acdba97f0be06134bf86d5a6 /lld/lib/ReaderWriter/MachO/File.h | |
parent | a4be967ebac09e9c45f802bdc068a7ce8ce7161d (diff) | |
download | bcm5719-llvm-9d98f7e454d928b97958e994060d8f6dcf0ac9c3.tar.gz bcm5719-llvm-9d98f7e454d928b97958e994060d8f6dcf0ac9c3.zip |
[mach-o] use reference with "auto" to prevent copies
Patch by Jean-Daniel Dupas
llvm-svn: 222455
Diffstat (limited to 'lld/lib/ReaderWriter/MachO/File.h')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/File.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/MachO/File.h b/lld/lib/ReaderWriter/MachO/File.h index 7d0292d0e93..e01c6a894f5 100644 --- a/lld/lib/ReaderWriter/MachO/File.h +++ b/lld/lib/ReaderWriter/MachO/File.h @@ -118,13 +118,13 @@ public: MachODefinedAtom *findAtomCoveringAddress(const Section §ion, uint64_t offsetInSect, uint32_t *foundOffsetAtom=nullptr) { - auto pos = _sectionAtoms.find(§ion); + const auto& pos = _sectionAtoms.find(§ion); if (pos == _sectionAtoms.end()) return nullptr; - auto vec = pos->second; + const auto& vec = pos->second; assert(offsetInSect < section.content.size()); // Vector of atoms for section are already sorted, so do binary search. - auto atomPos = std::lower_bound(vec.begin(), vec.end(), offsetInSect, + const auto& atomPos = std::lower_bound(vec.begin(), vec.end(), offsetInSect, [offsetInSect](const SectionOffsetAndAtom &ao, uint64_t targetAddr) -> bool { // Each atom has a start offset of its slice of the |