Skip to content

Commit

Permalink
SourceCodeModel: dont call find for every line in disassemblyOutput
Browse files Browse the repository at this point in the history
there is no need to call this for every line since this is called on per
symbol basis
  • Loading branch information
lievenhey committed Apr 14, 2023
1 parent ad047de commit 37f5a8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/models/sourcecodemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void SourceCodeModel::setDisassembly(const DisassemblyOutput& disassemblyOutput,

m_mainSourceFileName = disassemblyOutput.mainSourceFileName;

const auto entry = results.entries.find(disassemblyOutput.symbol);

for (const auto& line : disassemblyOutput.disassemblyLines) {
if (line.fileLine.line == 0 || line.fileLine.file != disassemblyOutput.mainSourceFileName) {
continue;
Expand All @@ -84,7 +86,6 @@ void SourceCodeModel::setDisassembly(const DisassemblyOutput& disassemblyOutput,
if (m_validLineNumbers.contains(line.fileLine.line))
continue;

const auto entry = results.entries.find(disassemblyOutput.symbol);
if (entry != results.entries.end()) {
const auto it = entry->sourceMap.find(line.fileLine);
if (it != entry->sourceMap.end()) {
Expand Down

0 comments on commit 37f5a8d

Please sign in to comment.