summaryrefslogtreecommitdiff
path: root/lowlevelil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lowlevelil.cpp')
-rw-r--r--lowlevelil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lowlevelil.cpp b/lowlevelil.cpp
index c0419681..02301af9 100644
--- a/lowlevelil.cpp
+++ b/lowlevelil.cpp
@@ -176,6 +176,7 @@ vector<uint64_t> LowLevelILFunction::GetOperandList(ExprId expr, size_t listOper
size_t count;
uint64_t* operands = BNLowLevelILGetOperandList(m_object, expr, listOperand, &count);
vector<uint64_t> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
result.push_back(operands[i]);
BNLowLevelILFreeOperandList(operands);
@@ -404,11 +405,10 @@ bool LowLevelILFunction::GetExprText(Architecture* arch, ExprId expr, vector<Ins
return false;
tokens.clear();
+ tokens.reserve(count);
for (size_t i = 0; i < count; i++)
- {
tokens.emplace_back(list[i].type, list[i].context, list[i].text, list[i].address, list[i].value, list[i].size,
list[i].operand, list[i].confidence);
- }
BNFreeInstructionText(list, count);
return true;
@@ -425,11 +425,10 @@ bool LowLevelILFunction::GetInstructionText(Function* func, Architecture* arch,
return false;
tokens.clear();
+ tokens.reserve(count);
for (size_t i = 0; i < count; i++)
- {
tokens.emplace_back(list[i].type, list[i].context, list[i].text, list[i].address, list[i].value, list[i].size,
list[i].operand, list[i].confidence);
- }
BNFreeInstructionText(list, count);
return true;
@@ -454,6 +453,7 @@ vector<Ref<BasicBlock>> LowLevelILFunction::GetBasicBlocks() const
BNBasicBlock** blocks = BNGetLowLevelILBasicBlockList(m_object, &count);
vector<Ref<BasicBlock>> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
result.push_back(new BasicBlock(BNNewBasicBlockReference(blocks[i])));