mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 17:19:44 -06:00
Modernize std::all_of
with ranges
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
This commit is contained in:
@ -377,15 +377,15 @@ void GameList::ShowContextMenu(const QPoint&)
|
||||
{
|
||||
const auto selected_games = GetSelectedGames();
|
||||
|
||||
if (std::all_of(selected_games.begin(), selected_games.end(),
|
||||
[](const auto& game) { return game->ShouldAllowConversion(); }))
|
||||
if (std::ranges::all_of(selected_games,
|
||||
[](const auto& game) { return game->ShouldAllowConversion(); }))
|
||||
{
|
||||
menu->addAction(tr("Convert Selected Files..."), this, &GameList::ConvertFile);
|
||||
menu->addSeparator();
|
||||
}
|
||||
|
||||
if (std::all_of(selected_games.begin(), selected_games.end(),
|
||||
[](const auto& game) { return DiscIO::IsWii(game->GetPlatform()); }))
|
||||
if (std::ranges::all_of(selected_games,
|
||||
[](const auto& game) { return DiscIO::IsWii(game->GetPlatform()); }))
|
||||
{
|
||||
menu->addAction(tr("Export Wii Saves"), this, &GameList::ExportWiiSave);
|
||||
menu->addSeparator();
|
||||
|
Reference in New Issue
Block a user