mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Use C++20 erase_if() instead of erase(remove_if()) (NFC)
This commit is contained in:
@ -803,15 +803,11 @@ bool GameList::AddShortcutToDesktop()
|
||||
|
||||
std::string game_name = game->GetName(Core::TitleDatabase());
|
||||
// Sanitize the string by removing all characters that cannot be used in NTFS file names
|
||||
game_name.erase(std::remove_if(game_name.begin(), game_name.end(),
|
||||
[](char ch) {
|
||||
static constexpr char illegal_characters[] = {
|
||||
'<', '>', ':', '\"', '/', '\\', '|', '?', '*'};
|
||||
return std::find(std::begin(illegal_characters),
|
||||
std::end(illegal_characters),
|
||||
ch) != std::end(illegal_characters);
|
||||
}),
|
||||
game_name.end());
|
||||
std::erase_if(game_name, [](char ch) {
|
||||
static constexpr char illegal_characters[] = {'<', '>', ':', '\"', '/', '\\', '|', '?', '*'};
|
||||
return std::find(std::begin(illegal_characters), std::end(illegal_characters), ch) !=
|
||||
std::end(illegal_characters);
|
||||
});
|
||||
|
||||
std::wstring desktop_path = std::wstring(desktop.get()) + UTF8ToTStr("\\" + game_name + ".lnk");
|
||||
auto persist_file = shell_link.try_query<IPersistFile>();
|
||||
|
Reference in New Issue
Block a user