diff --git a/Source/Core/Core/CoreTiming.cpp b/Source/Core/Core/CoreTiming.cpp index b304ff2fa6..7fe8160da8 100644 --- a/Source/Core/Core/CoreTiming.cpp +++ b/Source/Core/Core/CoreTiming.cpp @@ -282,13 +282,12 @@ void CoreTimingManager::ScheduleEvent(s64 cycles_into_future, EventType* event_t void CoreTimingManager::RemoveEvent(EventType* event_type) { - auto itr = std::remove_if(m_event_queue.begin(), m_event_queue.end(), - [&](const Event& e) { return e.type == event_type; }); + const size_t erased = + std::erase_if(m_event_queue, [&](const Event& e) { return e.type == event_type; }); // Removing random items breaks the invariant so we have to re-establish it. - if (itr != m_event_queue.end()) + if (erased != 0) { - m_event_queue.erase(itr, m_event_queue.end()); std::make_heap(m_event_queue.begin(), m_event_queue.end(), std::greater()); } } diff --git a/Source/Core/DiscIO/DiscUtils.cpp b/Source/Core/DiscIO/DiscUtils.cpp index cdfcb015c4..afd22117c6 100644 --- a/Source/Core/DiscIO/DiscUtils.cpp +++ b/Source/Core/DiscIO/DiscUtils.cpp @@ -131,11 +131,9 @@ u64 GetBiggestReferencedOffset(const Volume& volume) // This can happen when certain programs that create WBFS files scrub the entirety of // the Masterpiece partitions in Super Smash Bros. Brawl without removing them from // the partition table. https://bugs.dolphin-emu.org/issues/8733 - const auto it = - std::remove_if(partitions.begin(), partitions.end(), [&](const Partition& partition) { - return volume.ReadSwapped(0x18, partition) != WII_DISC_MAGIC; - }); - partitions.erase(it, partitions.end()); + std::erase_if(partitions, [&](const Partition& partition) { + return volume.ReadSwapped(0x18, partition) != WII_DISC_MAGIC; + }); if (partitions.empty()) partitions.push_back(PARTITION_NONE); diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp index 97c596b969..f1d69613a3 100644 --- a/Source/Core/DolphinQt/GameList/GameList.cpp +++ b/Source/Core/DolphinQt/GameList/GameList.cpp @@ -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(); diff --git a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp index ab266292bc..769e6c5f0e 100644 --- a/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ControllerInterface.cpp @@ -308,7 +308,7 @@ void ControllerInterface::RemoveDevice(std::functionGetQualifiedName()); @@ -316,9 +316,7 @@ void ControllerInterface::RemoveDevice(std::function