diff options
| author | Scott Lagler <laglerscott@gmail.com> | 2025-12-12 19:20:21 -0500 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2025-12-16 17:45:24 -0500 |
| commit | 6138978808829172448615980742756831959788 (patch) | |
| tree | 746bb0a634c139967c1755dcbcfb8c3395b97ff5 /type.cpp | |
| parent | 3967000448807875468673398445854536525610 (diff) | |
Add more reserve calls
Diffstat (limited to 'type.cpp')
| -rw-r--r-- | type.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |
