mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Preallocate vectors with known size.
This commit is contained in:
@@ -1129,9 +1129,11 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
|
||||
|
||||
Vector<uint32_t> compat_hashes = ClassDB::get_method_compatibility_hashes(class_name, method_name);
|
||||
Array compatibility;
|
||||
if (compat_hashes.size()) {
|
||||
for (int i = 0; i < compat_hashes.size(); i++) {
|
||||
compatibility.push_back(compat_hashes[i]);
|
||||
size_t compat_hashes_size = compat_hashes.size();
|
||||
if (compat_hashes_size) {
|
||||
compatibility.resize(compat_hashes_size);
|
||||
for (size_t i = 0; i < compat_hashes_size; i++) {
|
||||
compatibility[i] = compat_hashes[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user