diff options
| author | 2021-04-06 20:06:18 +0100 | |
|---|---|---|
| committer | 2021-04-07 10:36:11 +0100 | |
| commit | 942fd2bcfd384a12c900999fe663202c87319a68 (patch) | |
| tree | c2bad1906af27afbc3c7d96c3e5ca3c27c83f090 /src/modules/m_ident.cpp | |
| parent | Merge branch 'insp3' into master. (diff) | |
Switch simple iterator loops to use range-based for loops.
Diffstat (limited to 'src/modules/m_ident.cpp')
| -rw-r--r-- | src/modules/m_ident.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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); |
