From b4ab7dadb94c463b46e8bef5bce8c8c531bf1995 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 8 Mar 2025 12:41:22 +0000 Subject: Use a C++11 lambda instead of a channel sorting method. --- modules/nickserv/ns_alist.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modules/nickserv') diff --git a/modules/nickserv/ns_alist.cpp b/modules/nickserv/ns_alist.cpp index 526288aca..4b246f54f 100644 --- a/modules/nickserv/ns_alist.cpp +++ b/modules/nickserv/ns_alist.cpp @@ -14,11 +14,6 @@ class CommandNSAList final : public Command { - static bool ChannelSort(ChannelInfo *ci1, ChannelInfo *ci2) - { - return ci::less()(ci1->name, ci2->name); - } - public: CommandNSAList(Module *creator) : Command(creator, "nickserv/alist", 0, 2) { @@ -50,7 +45,9 @@ public: std::deque queue; nc->GetChannelReferences(queue); - std::sort(queue.begin(), queue.end(), ChannelSort); + std::sort(queue.begin(), queue.end(), [](auto *lhs, auto *rhs) { + return ci::less()(lhs->name, rhs->name); + }); for (auto *ci : queue) { -- cgit