From afd5d9c38bcd491a49e29a6d4bef00d86212ab50 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 16 Jul 2024 19:32:14 +0100 Subject: Migrate from erase(remove_if) to erase_if. --- src/modules/m_timedbans.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/modules/m_timedbans.cpp') diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index cda2ce647..27d476f7d 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -199,22 +199,6 @@ public: } }; -class ChannelMatcher final -{ - Channel* const chan; - -public: - ChannelMatcher(Channel* ch) - : chan(ch) - { - } - - bool operator()(const TimedBan& tb) const - { - return (tb.chan == chan); - } -}; - class ModuleTimedBans final : public Module { @@ -275,7 +259,7 @@ public: void OnChannelDelete(Channel* chan) override { // Remove all timed bans affecting the channel from internal bookkeeping - TimedBanList.erase(std::remove_if(TimedBanList.begin(), TimedBanList.end(), ChannelMatcher(chan)), TimedBanList.end()); + std::erase_if(TimedBanList, [chan](const TimedBan& tb) { return tb.chan == chan; }); } }; -- cgit v1.3.1-10-gc9f91