Skip to content

Commit

Permalink
Use structured binding for pair values
Browse files Browse the repository at this point in the history
dir_path is used by PanicAlertFormatT, which prior to PR 10209 used a
lambda. Before c++20, referring to structured bindings in lambda captures
was forbidden. The problem is now doubly fixed, so put the structured
binding back in.
  • Loading branch information
Dentomologist committed Aug 6, 2022
1 parent d48d317 commit ff26f64
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Source/Core/Core/HW/EXI/EXI_DeviceMemoryCard.cpp
Expand Up @@ -178,11 +178,7 @@ void CEXIMemoryCard::SetupGciFolder(const Memcard::HeaderData& header_data)
current_game_id = Common::swap32(reinterpret_cast<const u8*>(game_id.c_str()));
}

// TODO(C++20): Use structured bindings when we can use C++20 and refer to structured bindings
// in lambda captures
const auto folder_path_pair = GetGCIFolderPath(m_card_slot, AllowMovieFolder::Yes);
const std::string& dir_path = folder_path_pair.first;
const bool migrate = folder_path_pair.second;
const auto [dir_path, migrate] = GetGCIFolderPath(m_card_slot, AllowMovieFolder::Yes);

const File::FileInfo file_info(dir_path);
if (!file_info.Exists())
Expand Down

0 comments on commit ff26f64

Please sign in to comment.