From 865be48ee3d77211674b1588a1a5cb479e38b3cd Mon Sep 17 00:00:00 2001 From: JosJuice Date: Tue, 5 Jul 2016 21:13:43 +0200 Subject: [PATCH] Movie: Simplify ChangeDisc path handling --- Source/Core/Core/Movie.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Movie.cpp b/Source/Core/Core/Movie.cpp index d8f085bcb8..eb6d63b4b9 100644 --- a/Source/Core/Core/Movie.cpp +++ b/Source/Core/Core/Movie.cpp @@ -1211,16 +1211,15 @@ void PlayController(GCPadStatus* PadStatus, int controllerID) PadStatus->button |= PAD_TRIGGER_R; if (s_padState.disc) { - // This implementation assumes the disc change will only happen once. Trying to change more than - // that will cause - // it to load the last disc every time. As far as i know though, there are no 3+ disc games, so - // this should be fine. + // This implementation assumes the disc change will only happen once. Trying + // to change more than that will cause it to load the last disc every time. + // As far as I know, there are no 3+ disc games, so this should be fine. bool found = false; std::string path; - for (size_t i = 0; i < SConfig::GetInstance().m_ISOFolder.size(); ++i) + for (const std::string& iso_folder : SConfig::GetInstance().m_ISOFolder) { - path = SConfig::GetInstance().m_ISOFolder[i]; - if (File::Exists(path + '/' + g_discChange)) + path = iso_folder + '/' + g_discChange; + if (File::Exists(path)) { found = true; break; @@ -1228,7 +1227,6 @@ void PlayController(GCPadStatus* PadStatus, int controllerID) } if (found) { - path += '/' + g_discChange; DVDInterface::ChangeDiscAsCPU(path); } else