diff --git a/Source/Core/Core/HW/GCMemcard/GCIFile.cpp b/Source/Core/Core/HW/GCMemcard/GCIFile.cpp index dcb04e8a31..1cb6db39de 100644 --- a/Source/Core/Core/HW/GCMemcard/GCIFile.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCIFile.cpp @@ -90,13 +90,7 @@ void GCIFile::DoState(PointerWrap& p) p.Do(m_gci_header); p.Do(m_dirty); p.Do(m_filename); - int num_blocks = (int)m_save_data.size(); - p.Do(num_blocks); - m_save_data.resize(num_blocks); - for (auto itr = m_save_data.begin(); itr != m_save_data.end(); ++itr) - { - p.Do(*itr); - } + p.Do(m_save_data); p.Do(m_used_blocks); } } // namespace Memcard diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp index 4acfb9a895..cbfbc200f3 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp @@ -701,13 +701,7 @@ void GCMemcardDirectory::DoState(PointerWrap& p) p.Do(m_dir2); p.Do(m_bat1); p.Do(m_bat2); - int num_saves = (int)m_saves.size(); - p.Do(num_saves); - m_saves.resize(num_saves); - for (Memcard::GCIFile& save : m_saves) - { - save.DoState(p); - } + p.DoEachElement(m_saves, [](PointerWrap& p, Memcard::GCIFile& save) { save.DoState(p); }); } void MigrateFromMemcardFile(const std::string& directory_name, ExpansionInterface::Slot card_slot, diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index a1fc21f766..314ae81ebe 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -94,7 +94,7 @@ static size_t s_state_writes_in_queue; static std::condition_variable s_state_write_queue_is_empty; // Don't forget to increase this after doing changes on the savestate system -constexpr u32 STATE_VERSION = 149; // Last changed in PR 10781 +constexpr u32 STATE_VERSION = 150; // Last changed in PR 11124 // Maps savestate versions to Dolphin versions. // Versions after 42 don't need to be added to this list,