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 Mar 17, 2023
1 parent d988d9a commit 9ac0bb0
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 @@ -61,6 +61,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 @@ -76,7 +78,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 9ac0bb0

Please sign in to comment.