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. --- include/channelmanager.h | 4 ++-- include/inspircd.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/channelmanager.h b/include/channelmanager.h index 69acf5a7a..de3d25cf3 100644 --- a/include/channelmanager.h +++ b/include/channelmanager.h @@ -31,14 +31,14 @@ private: public: /** Determines whether an channel name is valid. */ - std::function IsChannel = DefaultIsChannel; + std::function IsChannel = DefaultIsChannel; /** Determines whether a channel name is valid according to the RFC 1459 rules. * This is the default function for InspIRCd::IsChannel. * @param channel The channel name to validate. * @return True if the channel name is valid according to RFC 1459 rules; otherwise, false. */ - static bool DefaultIsChannel(const std::string& channel); + static bool DefaultIsChannel(const std::string_view& channel); /** Finds a channel by name. * @param channel The name of the channel to look up. diff --git a/include/inspircd.h b/include/inspircd.h index 8beeae9b1..0ca6bf8c4 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -373,24 +373,24 @@ public: static std::string Format(va_list& vaList, const char* formatString) ATTR_PRINTF(2, 0); /** Determines whether a nickname is valid. */ - std::function IsNick; + std::function IsNick; /** Determines whether a nickname is valid according to the RFC 1459 rules. * This is the default function for InspIRCd::IsNick. * @param nick The nickname to validate. * @return True if the nickname is valid according to RFC 1459 rules; otherwise, false. */ - static bool DefaultIsNick(const std::string& nick); + static bool DefaultIsNick(const std::string_view& nick); /** Determines whether an ident is valid. */ - std::function IsIdent; + std::function IsIdent; /** Determines whether a ident is valid according to the RFC 1459 rules. * This is the default function for InspIRCd::IsIdent. * @param ident The ident to validate. * @return True if the ident is valid according to RFC 1459 rules; otherwise, false. */ - static bool DefaultIsIdent(const std::string& ident); + static bool DefaultIsIdent(const std::string_view& ident); /** Match two strings using pattern matching, optionally, with a map * to check case against (may be NULL). If map is null, match will be case insensitive. -- cgit v1.3.1-10-gc9f91