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 --- mediumlevelilinstruction.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mediumlevelilinstruction.cpp') diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index 5e5c28fb..8a026aad 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -434,6 +434,7 @@ uint64_t MediumLevelILIntegerList::operator[](size_t i) const MediumLevelILIntegerList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -488,6 +489,7 @@ size_t MediumLevelILIndexList::operator[](size_t i) const MediumLevelILIndexList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -600,6 +602,7 @@ const Variable MediumLevelILVariableList::operator[](size_t i) const MediumLevelILVariableList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -658,6 +661,7 @@ const SSAVariable MediumLevelILSSAVariableList::operator[](size_t i) const MediumLevelILSSAVariableList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -716,6 +720,7 @@ const MediumLevelILInstruction MediumLevelILInstructionList::operator[](size_t i MediumLevelILInstructionList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; @@ -898,6 +903,7 @@ const MediumLevelILOperand MediumLevelILOperandList::operator[](size_t i) const MediumLevelILOperandList::operator vector() const { vector result; + result.reserve(size()); for (auto i : *this) result.push_back(i); return result; -- cgit v1.3.1