diff options
| author | Kazu Hirata <kazu@google.com> | 2025-02-19 08:21:10 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-19 08:21:10 -0800 |
| commit | 1bb72f0d7dd623e1c75dbe9e6a7f6b41f5284474 (patch) | |
| tree | 6b006a6d11bdd9b9e005b36d2a159b6adce60c56 /llvm/lib/Object/GOFFObjectFile.cpp | |
| parent | af922cf9f7e7f126f2efaf9660ceea8e5eba21b5 (diff) | |
[Object] Avoid repeated hash lookups (NFC) (#127746)
Diffstat (limited to 'llvm/lib/Object/GOFFObjectFile.cpp')
| -rw-r--r-- | llvm/lib/Object/GOFFObjectFile.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Object/GOFFObjectFile.cpp b/llvm/lib/Object/GOFFObjectFile.cpp index 7806953aecd2..a55005e689e6 100644 --- a/llvm/lib/Object/GOFFObjectFile.cpp +++ b/llvm/lib/Object/GOFFObjectFile.cpp @@ -503,8 +503,9 @@ GOFFObjectFile::getSectionContents(DataRefImpl Sec) const { std::copy(CompleteData.data(), CompleteData.data() + TxtDataSize, Data.begin() + TxtDataOffset); } - SectionDataCache[Sec.d.a] = Data; - return ArrayRef<uint8_t>(SectionDataCache[Sec.d.a]); + auto &Cache = SectionDataCache[Sec.d.a]; + Cache = Data; + return ArrayRef<uint8_t>(Cache); } uint64_t GOFFObjectFile::getSectionAlignment(DataRefImpl Sec) const { |
