diff options
Diffstat (limited to 'src/modules/m_sethost.cpp')
| -rw-r--r-- | src/modules/m_sethost.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index af87b58ba..239f95b8b 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -48,9 +48,9 @@ class CommandSethost : public Command return CmdResult::FAILURE; } - for (std::string::const_iterator x = parameters[0].begin(); x != parameters[0].end(); x++) + for (const auto& chr : parameters[0]) { - if (!hostmap.test(static_cast<unsigned char>(*x))) + if (!hostmap.test(static_cast<unsigned char>(chr))) { user->WriteNotice("*** SETHOST: Invalid characters in hostname"); return CmdResult::FAILURE; @@ -86,8 +86,8 @@ class ModuleSetHost : 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)); } }; |
