From 07246800fd2e44128adfa09fe91ce10b3ef0bcfc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 21 Nov 2022 13:14:19 +0000 Subject: Use string_view in IsNick/IsIdent/IsChannel. --- src/helperfuncs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 1dbc62cb9..6f023cf82 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -158,12 +158,12 @@ void InspIRCd::ProcessColors(std::vector& input) } /* true for valid nickname, false else */ -bool InspIRCd::DefaultIsNick(const std::string& n) +bool InspIRCd::DefaultIsNick(const std::string_view& n) { if (n.empty() || n.length() > ServerInstance->Config->Limits.MaxNick) return false; - for (std::string::const_iterator i = n.begin(); i != n.end(); ++i) + for (std::string_view::const_iterator i = n.begin(); i != n.end(); ++i) { if ((*i >= 'A') && (*i <= '}')) { @@ -185,7 +185,7 @@ bool InspIRCd::DefaultIsNick(const std::string& n) } /* return true for good ident, false else */ -bool InspIRCd::DefaultIsIdent(const std::string& n) +bool InspIRCd::DefaultIsIdent(const std::string_view& n) { if (n.empty()) return false; -- cgit v1.3.1-10-gc9f91