[BPF] Avoid repeated hash lookups (NFC) (#131265)
Co-authored-by: Nikita Popov <github@npopov.com>
diff --git a/llvm/lib/Target/BPF/BTFDebug.cpp b/llvm/lib/Target/BPF/BTFDebug.cpp
index c58b61f..8f2274e 100644
--- a/llvm/lib/Target/BPF/BTFDebug.cpp
+++ b/llvm/lib/Target/BPF/BTFDebug.cpp
@@ -1026,8 +1026,9 @@
LineInfo.Label = Label;
LineInfo.FileNameOff = addString(FileName);
// If file content is not available, let LineOff = 0.
- if (Line < FileContent[FileName].size())
- LineInfo.LineOff = addString(FileContent[FileName][Line]);
+ const auto &Content = FileContent[FileName];
+ if (Line < Content.size())
+ LineInfo.LineOff = addString(Content[Line]);
else
LineInfo.LineOff = 0;
LineInfo.LineNum = Line;