From 7886123e65fab6752ece4d7b4bf361671cc143ac Mon Sep 17 00:00:00 2001 From: korenkonder Date: Thu, 1 Feb 2024 01:22:55 +0300 Subject: [PATCH] Why it wasn't a thing??? --- src/KKdLib/database/aet.cpp | 2 ++ src/KKdLib/database/sprite.cpp | 2 ++ src/KKdLib/database/texture.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/src/KKdLib/database/aet.cpp b/src/KKdLib/database/aet.cpp index 07ab1073..1867ef9e 100644 --- a/src/KKdLib/database/aet.cpp +++ b/src/KKdLib/database/aet.cpp @@ -569,6 +569,7 @@ static void aet_database_file_classic_write_inner(aet_database_file* aet_db, str std::vector string_offsets; strings.reserve(aet_sets_count + aets_count); + string_offsets.reserve(aet_sets_count + aets_count); for (aet_db_aet_set_file& i : aet_db->aet_set) for (aet_db_aet_file& j : i.aet) @@ -788,6 +789,7 @@ static void aet_database_file_modern_write_inner(aet_database_file* aet_db, stre std::vector string_offsets; strings.reserve(aet_sets_count + aets_count); + string_offsets.reserve(aet_sets_count + aets_count); for (aet_db_aet_set_file& i : aet_db->aet_set) { if (aet_database_file_strings_push_back_check(strings, i.name)) { diff --git a/src/KKdLib/database/sprite.cpp b/src/KKdLib/database/sprite.cpp index 3e8331db..959b5954 100644 --- a/src/KKdLib/database/sprite.cpp +++ b/src/KKdLib/database/sprite.cpp @@ -578,6 +578,7 @@ static void sprite_database_file_classic_write_inner(sprite_database_file* spr_d std::vector string_offsets; strings.reserve(sprite_sets_count + sprites_count); + string_offsets.reserve(sprite_sets_count + sprites_count); for (spr_db_spr_set_file& i : spr_db->sprite_set) { for (spr_db_spr_file& j : i.sprite) @@ -818,6 +819,7 @@ static void sprite_database_file_modern_write_inner(sprite_database_file* spr_db std::vector string_offsets; strings.reserve(sprite_sets_count + sprites_count); + string_offsets.reserve(sprite_sets_count + sprites_count); for (spr_db_spr_set_file& i : spr_db->sprite_set) { if (sprite_database_file_strings_push_back_check(strings, i.name)) { diff --git a/src/KKdLib/database/texture.cpp b/src/KKdLib/database/texture.cpp index e1e21ba6..fafaa67a 100644 --- a/src/KKdLib/database/texture.cpp +++ b/src/KKdLib/database/texture.cpp @@ -447,6 +447,7 @@ static void texture_database_file_modern_write_inner(texture_database_file* tex_ std::vector string_offsets; strings.reserve(textures_count); + string_offsets.reserve(textures_count); for (texture_info_file& i : tex_db->texture) texture_database_file_strings_push_back_check(strings, i.name);