From 9fa689a8069fa5d5c5d358bbb17aaf8b19c6d0e5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 23 Apr 2020 07:13:18 -0400 Subject: [PATCH] CMemoryCardSys: Eliminate variable shadowing Prevents names from clashing with variables from outside the loop scope. --- Runtime/CMemoryCardSys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/CMemoryCardSys.cpp b/Runtime/CMemoryCardSys.cpp index 45b885485..c0b57895b 100644 --- a/Runtime/CMemoryCardSys.cpp +++ b/Runtime/CMemoryCardSys.cpp @@ -123,10 +123,10 @@ bool CMemoryCardSys::InitializePump() { x20_scanStates.reserve(x20_scanStates.size() + savw.GetScans().size()); for (const CSaveWorld::SScanState& scan : savw.GetScans()) { - auto existingSearch = std::find_if(x20_scanStates.begin(), x20_scanStates.end(), [&](const auto& test) { + const auto scanStateIter = std::find_if(x20_scanStates.cbegin(), x20_scanStates.cend(), [&](const auto& test) { return test.first == scan.x0_id && test.second == scan.x4_category; }); - if (existingSearch == x20_scanStates.end()) { + if (scanStateIter == x20_scanStates.cend()) { x20_scanStates.emplace_back(scan.x0_id, scan.x4_category); ++x30_scanCategoryCounts[int(scan.x4_category)]; }