summaryrefslogtreecommitdiff
path: root/binaryview.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-12-03 22:20:28 -0500
committerPeter LaFosse <peter@vector35.com>2018-12-13 13:32:18 -0500
commit231afab8b0ba6c8c9eff879681c52724b6688c18 (patch)
tree38026cfa20f34702b7267e9c397652119f27ebe7 /binaryview.cpp
parent7357dd114a145ca64e7356233c3cb8b9dd9eae84 (diff)
Commonize all InstructionTextToken generation
Diffstat (limited to 'binaryview.cpp')
-rw-r--r--binaryview.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/binaryview.cpp b/binaryview.cpp
index bc8f5050..c8c9d760 100644
--- a/binaryview.cpp
+++ b/binaryview.cpp
@@ -1772,20 +1772,7 @@ vector<LinearDisassemblyLine> BinaryView::GetPreviousLinearDisassemblyLines(Line
line.contents.addr = lines[i].contents.addr;
line.contents.instrIndex = lines[i].contents.instrIndex;
line.contents.highlight = lines[i].contents.highlight;
- line.contents.tokens.reserve(lines[i].contents.count);
- for (size_t j = 0; j < lines[i].contents.count; j++)
- {
- InstructionTextToken token;
- token.type = lines[i].contents.tokens[j].type;
- token.text = lines[i].contents.tokens[j].text;
- token.value = lines[i].contents.tokens[j].value;
- token.size = lines[i].contents.tokens[j].size;
- token.operand = lines[i].contents.tokens[j].operand;
- token.context = lines[i].contents.tokens[j].context;
- token.confidence = lines[i].contents.tokens[j].confidence;
- token.address = lines[i].contents.tokens[j].address;
- line.contents.tokens.push_back(token);
- }
+ line.contents.tokens = InstructionTextToken::ConvertInstructionTextTokenList(lines[i].contents.tokens, lines[i].contents.count);
result.push_back(line);
}
@@ -1822,20 +1809,7 @@ vector<LinearDisassemblyLine> BinaryView::GetNextLinearDisassemblyLines(LinearDi
line.contents.addr = lines[i].contents.addr;
line.contents.instrIndex = lines[i].contents.instrIndex;
line.contents.highlight = lines[i].contents.highlight;
- line.contents.tokens.reserve(lines[i].contents.count);
- for (size_t j = 0; j < lines[i].contents.count; j++)
- {
- InstructionTextToken token;
- token.type = lines[i].contents.tokens[j].type;
- token.text = lines[i].contents.tokens[j].text;
- token.value = lines[i].contents.tokens[j].value;
- token.size = lines[i].contents.tokens[j].size;
- token.operand = lines[i].contents.tokens[j].operand;
- token.context = lines[i].contents.tokens[j].context;
- token.confidence = lines[i].contents.tokens[j].confidence;
- token.address = lines[i].contents.tokens[j].address;
- line.contents.tokens.push_back(token);
- }
+ line.contents.tokens = InstructionTextToken::ConvertInstructionTextTokenList(lines[i].contents.tokens, lines[i].contents.count);
result.push_back(line);
}