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_ident.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_ident.cpp') diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 54927d6f8..0cb029bb0 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -236,20 +236,20 @@ class IdentRequestSocket : public EventHandler std::string::size_type lastcolon = buf.rfind(':'); /* Truncate the ident at any characters we don't like, skip leading spaces */ - for (std::string::const_iterator i = buf.begin()+lastcolon+1; i != buf.end(); ++i) + for (const auto& chr : insp::iterator_range(buf.begin() + lastcolon + 1, buf.end())) { if (result.size() == ServerInstance->Config->Limits.MaxUser) /* Ident is getting too long */ break; - if (*i == ' ') + if (chr == ' ') continue; /* Add the next char to the result and see if it's still a valid ident, * according to IsIdent(). If it isn't, then erase what we just added and * we're done. */ - result += *i; + result += chr; if (!ServerInstance->IsIdent(result)) { result.erase(result.end()-1); -- cgit v1.3.1-10-gc9f91