Skip to content

Commit 1bb72f0

Browse files
[Object] Avoid repeated hash lookups (NFC) (llvm#127746)
1 parent af922cf commit 1bb72f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Object/GOFFObjectFile.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,9 @@ GOFFObjectFile::getSectionContents(DataRefImpl Sec) const {
503503
std::copy(CompleteData.data(), CompleteData.data() + TxtDataSize,
504504
Data.begin() + TxtDataOffset);
505505
}
506-
SectionDataCache[Sec.d.a] = Data;
507-
return ArrayRef<uint8_t>(SectionDataCache[Sec.d.a]);
506+
auto &Cache = SectionDataCache[Sec.d.a];
507+
Cache = Data;
508+
return ArrayRef<uint8_t>(Cache);
508509
}
509510

510511
uint64_t GOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const {

0 commit comments

Comments
 (0)