summaryrefslogtreecommitdiff
path: root/type.cpp
diff options
context:
space:
mode:
authorScott Lagler <laglerscott@gmail.com>2025-12-12 19:20:21 -0500
committerGlenn Smith <glenn@vector35.com>2025-12-16 17:45:24 -0500
commit6138978808829172448615980742756831959788 (patch)
tree746bb0a634c139967c1755dcbcfb8c3395b97ff5 /type.cpp
parent3967000448807875468673398445854536525610 (diff)
Add more reserve calls
Diffstat (limited to 'type.cpp')
-rw-r--r--type.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/type.cpp b/type.cpp
index 086ac863..bd7dbaf2 100644
--- a/type.cpp
+++ b/type.cpp
@@ -758,6 +758,7 @@ std::vector<TypeAttribute> Type::GetAttributes() const
size_t count = 0;
BNTypeAttribute* attributes = BNGetTypeAttributes(m_object, &count);
std::vector<TypeAttribute> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
result.emplace_back(attributes[i].name, attributes[i].value);
BNFreeTypeAttributeList(attributes, count);
@@ -2259,6 +2260,7 @@ std::vector<TypeAttribute> TypeBuilder::GetAttributes() const
size_t count;
BNTypeAttribute* attributes = BNGetTypeBuilderAttributes(m_object, &count);
std::vector<TypeAttribute> result;
+ result.reserve(count);
for (size_t i = 0; i < count; i++)
result.emplace_back(attributes[i].name, attributes[i].value);
BNFreeTypeAttributeList(attributes, count);