aboutsummaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-11-21 13:14:19 +0000
committerGravatar Sadie Powell2022-11-21 13:14:19 +0000
commit07246800fd2e44128adfa09fe91ce10b3ef0bcfc (patch)
tree964d9fc4275dc612e5dfb083d2d1abb035fa1719 /src/helperfuncs.cpp
parentFix iterator_range when the range points to a string_view. (diff)
Use string_view in IsNick/IsIdent/IsChannel.
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp6
1 files changed, 3 insertions, 3 deletions
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<std::string>& 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;