summaryrefslogtreecommitdiff
path: root/debuginfo.cpp
diff options
context:
space:
mode:
authorScott Lagler <laglerscott@gmail.com>2025-12-09 22:08:06 -0500
committerGlenn Smith <glenn@vector35.com>2025-12-16 17:39:41 -0500
commit3967000448807875468673398445854536525610 (patch)
treeec8e5b7638fdb18540fcdddad0b623df0d28e8a6 /debuginfo.cpp
parent908a18947d34b06da936a464a69f71e9e0a4eec3 (diff)
Add missing std::vector reserve calls
# Conflicts: # function.cpp
Diffstat (limited to 'debuginfo.cpp')
-rw-r--r--debuginfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/debuginfo.cpp b/debuginfo.cpp
index b3f14383..ec02db4b 100644
--- a/debuginfo.cpp
+++ b/debuginfo.cpp
@@ -91,13 +91,16 @@ vector<DebugFunctionInfo> DebugInfo::GetFunctions(const string& parserName) cons
return {};
vector<DebugFunctionInfo> result;
+ result.reserve(count);
for (size_t i = 0; i < count; ++i)
{
vector<string> components;
+ components.reserve(functions[i].componentN);
for (size_t componentN = 0; componentN < functions[i].componentN; ++componentN)
components.emplace_back(functions[i].components[componentN]);
vector<VariableNameAndType> localVariables;
+ localVariables.reserve(functions[i].localVariableN);
for (size_t localVariableN = 0; localVariableN < functions[i].localVariableN; ++localVariableN)
{
auto& bnVar = functions[i].localVariables[localVariableN];