Skip to content

Commit b0d1c51

Browse files
[DebugInfo] Avoid repeated hash lookups (NFC) (llvm#128395)
1 parent 2ff3b18 commit b0d1c51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewReader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ void LVCodeViewReader::cacheRelocations() {
162162
for (const SectionRef &Section : getObj().sections()) {
163163
const coff_section *CoffSection = getObj().getCOFFSection(Section);
164164

165+
auto &RM = RelocMap[CoffSection];
165166
for (const RelocationRef &Relocacion : Section.relocations())
166-
RelocMap[CoffSection].push_back(Relocacion);
167+
RM.push_back(Relocacion);
167168

168169
// Sort relocations by address.
169-
llvm::sort(RelocMap[CoffSection], [](RelocationRef L, RelocationRef R) {
170+
llvm::sort(RM, [](RelocationRef L, RelocationRef R) {
170171
return L.getOffset() < R.getOffset();
171172
});
172173
}

0 commit comments

Comments
 (0)