From 22c2873ccff4de8dcfbfa8c99388f934cd860740 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 14 Jul 2025 18:24:35 -0700 Subject: Reserve vector capacity when populating vectors in conversion operators --- highlevelilinstruction.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'highlevelilinstruction.cpp') diff --git a/highlevelilinstruction.cpp b/highlevelilinstruction.cpp index ce0e72ee..964e1af9 100644 --- a/highlevelilinstruction.cpp +++ b/highlevelilinstruction.cpp @@ -321,6 +321,7 @@ uint64_t HighLevelILIntegerList::operator[](size_t i) const HighLevelILIntegerList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -375,6 +376,7 @@ size_t HighLevelILIndexList::operator[](size_t i) const HighLevelILIndexList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -440,6 +442,7 @@ const HighLevelILInstruction HighLevelILInstructionList::operator[](size_t i) co HighLevelILInstructionList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -498,6 +501,7 @@ const SSAVariable HighLevelILSSAVariableList::operator[](size_t i) const HighLevelILSSAVariableList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -651,6 +655,7 @@ const HighLevelILOperand HighLevelILOperandList::operator[](size_t i) const HighLevelILOperandList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; -- cgit v1.3.1