From 942fd2bcfd384a12c900999fe663202c87319a68 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Apr 2021 20:06:18 +0100 Subject: Switch simple iterator loops to use range-based for loops. --- src/modules/m_chghost.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/m_chghost.cpp') 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(*x))) + if (!hostmap.test(static_cast(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(*n)); + for (const auto& chr : hmap) + cmd.hostmap.set(static_cast(chr)); } }; -- cgit v1.3.1-10-gc9f91