Skip to content

Commit 2198f54

Browse files
[BPF] Avoid repeated hash lookups (NFC) (#131265)
Co-authored-by: Nikita Popov <[email protected]>
1 parent 2a09523 commit 2198f54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/BPF/BTFDebug.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,9 @@ void BTFDebug::constructLineInfo(MCSymbol *Label, const DIFile *File,
10261026
LineInfo.Label = Label;
10271027
LineInfo.FileNameOff = addString(FileName);
10281028
// If file content is not available, let LineOff = 0.
1029-
if (Line < FileContent[FileName].size())
1030-
LineInfo.LineOff = addString(FileContent[FileName][Line]);
1029+
const auto &Content = FileContent[FileName];
1030+
if (Line < Content.size())
1031+
LineInfo.LineOff = addString(Content[Line]);
10311032
else
10321033
LineInfo.LineOff = 0;
10331034
LineInfo.LineNum = Line;

0 commit comments

Comments
 (0)