aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_chghost.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-04-06 20:06:18 +0100
committerGravatar Sadie Powell2021-04-07 10:36:11 +0100
commit942fd2bcfd384a12c900999fe663202c87319a68 (patch)
treec2bad1906af27afbc3c7d96c3e5ca3c27c83f090 /src/modules/m_chghost.cpp
parentMerge branch 'insp3' into master. (diff)
Switch simple iterator loops to use range-based for loops.
Diffstat (limited to 'src/modules/m_chghost.cpp')
-rw-r--r--src/modules/m_chghost.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index 3a1e955b5..cf0c6a52c 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -49,9 +49,9 @@ class CommandChghost : public Command
return CmdResult::FAILURE;
}
- for (std::string::const_iterator x = parameters[1].begin(); x != parameters[1].end(); x++)
+ for (const auto& chr : parameters[1])
{
- if (!hostmap.test(static_cast<unsigned char>(*x)))
+ if (!hostmap.test(static_cast<unsigned char>(chr)))
{
user->WriteNotice("*** CHGHOST: Invalid characters in hostname");
return CmdResult::FAILURE;
@@ -103,8 +103,8 @@ class ModuleChgHost : public Module
const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1);
cmd.hostmap.reset();
- for (std::string::const_iterator n = hmap.begin(); n != hmap.end(); n++)
- cmd.hostmap.set(static_cast<unsigned char>(*n));
+ for (const auto& chr : hmap)
+ cmd.hostmap.set(static_cast<unsigned char>(chr));
}
};