summaryrefslogtreecommitdiff
path: root/lowlevelil.cpp
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2018-01-14 03:42:04 -0500
committerBrian Potchik <brian@vector35.com>2018-01-14 03:42:04 -0500
commit0cc77206c79257d49013c3a3ed1bf889c85b10d1 (patch)
tree7c5ddd2f6e7d4c84e622064c74ca25873f82b97b /lowlevelil.cpp
parent4866de9b9f0ef32dfa568aa38faafdfd4def4638 (diff)
Container Memory Reservations.
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 6c59b704..5e985a8e 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);
@@ -390,11 +391,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;
@@ -411,11 +411,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;
@@ -440,6 +439,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])));