From 7ba25076818e42b4eac9199477a01101cf57e848 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 2 Sep 2013 12:33:28 +0200 Subject: Keep lists of mode handlers by type --- src/modules/m_autoop.cpp | 8 +++++--- src/modules/m_exemptchanops.cpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_autoop.cpp b/src/modules/m_autoop.cpp index d195345ca..a1b72714b 100644 --- a/src/modules/m_autoop.cpp +++ b/src/modules/m_autoop.cpp @@ -36,10 +36,12 @@ class AutoOpList : public ListModeBase { if (mid.length() == 1) return ServerInstance->Modes->FindPrefixMode(mid[0]); - for(char c='A'; c < 'z'; c++) + + const ModeParser::PrefixModeList& pmlist = ServerInstance->Modes->GetPrefixModes(); + for (ModeParser::PrefixModeList::const_iterator i = pmlist.begin(); i != pmlist.end(); ++i) { - PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(c); - if (mh && mh->name == mid) + PrefixMode* mh = *i; + if (mh->name == mid) return mh; } return NULL; diff --git a/src/modules/m_exemptchanops.cpp b/src/modules/m_exemptchanops.cpp index 5d8958665..a733fa475 100644 --- a/src/modules/m_exemptchanops.cpp +++ b/src/modules/m_exemptchanops.cpp @@ -65,10 +65,12 @@ class ExemptHandler : public HandlerBase3Modes->FindPrefixMode(mid[0]); - for(char c='A'; c < 'z'; c++) + + const ModeParser::PrefixModeList& pmlist = ServerInstance->Modes->GetPrefixModes(); + for (ModeParser::PrefixModeList::const_iterator i = pmlist.begin(); i != pmlist.end(); ++i) { - PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(c); - if (mh && mh->name == mid) + PrefixMode* mh = *i; + if (mh->name == mid) return mh; } return NULL; -- cgit v1.2.3