Fix pet_buffs.reserve to use cumulative size to avoid reallocations

Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-03-09 16:53:02 +00:00
parent 4788f7a6f1
commit 1b4cc695e0

View File

@ -3168,7 +3168,7 @@ void ZoneDatabase::SavePetInfo(Client *client)
pet_buff_count++;
}
pet_buffs.reserve(pet_buff_count);
pet_buffs.reserve(pet_buffs.size() + pet_buff_count);
for (int slot_id = 0; slot_id < max_slots; slot_id++) {
if (!IsValidOrSuppressedSpell(p->Buffs[slot_id].spellid)) {