summaryrefslogtreecommitdiff
path: root/modules/extra/m_regex_posix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/extra/m_regex_posix.cpp')
-rw-r--r--modules/extra/m_regex_posix.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/modules/extra/m_regex_posix.cpp b/modules/extra/m_regex_posix.cpp
index 75f58d0cb..9569a3b46 100644
--- a/modules/extra/m_regex_posix.cpp
+++ b/modules/extra/m_regex_posix.cpp
@@ -1,6 +1,6 @@
/*
*
- * (C) 2012-2023 Anope Team
+ * (C) 2012-2024 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
@@ -14,7 +14,7 @@ class POSIXRegex : public Regex
{
regex_t regbuf;
- public:
+public:
POSIXRegex(const Anope::string &expr) : Regex(expr)
{
int err = regcomp(&this->regbuf, expr.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE);
@@ -40,10 +40,10 @@ class POSIXRegex : public Regex
class POSIXRegexProvider : public RegexProvider
{
- public:
+public:
POSIXRegexProvider(Module *creator) : RegexProvider(creator, "regex/posix") { }
- Regex *Compile(const Anope::string &expression) anope_override
+ Regex *Compile(const Anope::string &expression) override
{
return new POSIXRegex(expression);
}
@@ -53,7 +53,7 @@ class ModuleRegexPOSIX : public Module
{
POSIXRegexProvider posix_regex_provider;
- public:
+public:
ModuleRegexPOSIX(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR),
posix_regex_provider(this)
{
@@ -62,15 +62,10 @@ class ModuleRegexPOSIX : public Module
~ModuleRegexPOSIX()
{
- for (std::list<XLineManager *>::iterator it = XLineManager::XLineManagers.begin(); it != XLineManager::XLineManagers.end(); ++it)
+ for (auto *xlm : XLineManager::XLineManagers)
{
- XLineManager *xlm = *it;
- const std::vector<XLine *> &xlines = xlm->GetList();
-
- for (unsigned int i = 0; i < xlines.size(); ++i)
+ for (auto *x : xlm->GetList())
{
- XLine *x = xlines[i];
-
if (x->regex && dynamic_cast<POSIXRegex *>(x->regex))
{
delete x->regex;