diff options
| author | 2024-07-16 19:32:14 +0100 | |
|---|---|---|
| committer | 2024-07-16 19:32:14 +0100 | |
| commit | afd5d9c38bcd491a49e29a6d4bef00d86212ab50 (patch) | |
| tree | 7cd93bee1ff1d983ad7246c8cdeee68199c49ced /src/modules/m_timedbans.cpp | |
| parent | Remove testssl. (diff) | |
Migrate from erase(remove_if) to erase_if.
Diffstat (limited to 'src/modules/m_timedbans.cpp')
| -rw-r--r-- | src/modules/m_timedbans.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
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; }); } }; |
