aboutsummaryrefslogtreecommitdiff
path: root/src/stringutils.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-14 08:04:42 +0000
committerGravatar Sadie Powell2026-03-14 17:04:18 +0000
commit25c3be929ad054fc96669a83c3dd8547dc069c40 (patch)
tree817c3fe4ab6827eeaf591356537bbbe8ebf421bd /src/stringutils.cpp
parentFix message tag parsing (diff)
Convert some more stuff over to string_view.
Diffstat (limited to 'src/stringutils.cpp')
-rw-r--r--src/stringutils.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/stringutils.cpp b/src/stringutils.cpp
index 40193106c..71ad8f396 100644
--- a/src/stringutils.cpp
+++ b/src/stringutils.cpp
@@ -259,13 +259,13 @@ std::string Template::Replace(const std::string_view& str, const VariableMap& va
}
-bool InspIRCd::TimingSafeCompare(const std::string& one, const std::string& two)
+bool InspIRCd::TimingSafeCompare(const std::string_view& one, const std::string_view& two)
{
if (one.length() != two.length())
return false;
unsigned int diff = 0;
- for (std::string::const_iterator i = one.begin(), j = two.begin(); i != one.end(); ++i, ++j)
+ for (auto i = one.begin(), j = two.begin(); i != one.end(); ++i, ++j)
{
unsigned char a = static_cast<unsigned char>(*i);
unsigned char b = static_cast<unsigned char>(*j);
@@ -395,7 +395,7 @@ bool TokenList::operator==(const TokenList& other) const
return true;
}
-MessageTokenizer::MessageTokenizer(const std::string& msg, std::string::size_type start, std::string::size_type end)
+MessageTokenizer::MessageTokenizer(const std::string_view& msg, std::string::size_type start, std::string::size_type end)
: message(msg, start, end)
{
}
@@ -466,7 +466,7 @@ bool MessageTokenizer::GetTrailing(std::string_view& token)
return GetMiddle(token);
}
-NumberRange::NumberRange(const std::string& range, bool sd, std::string::size_type start, std::string::size_type end)
+NumberRange::NumberRange(const std::string_view& range, bool sd, std::string::size_type start, std::string::size_type end)
: splitter(range, ',', false, start, end)
, skip_duplicates(sd)
{
@@ -575,7 +575,7 @@ bool NumberRange::Seen(uintmax_t num)
return !this->seen.insert(num).second;
}
-StringSplitter::StringSplitter(const std::string& str, std::string::value_type sep, bool ae, std::string::size_type start, std::string::size_type end)
+StringSplitter::StringSplitter(const std::string_view& str, std::string::value_type sep, bool ae, std::string::size_type start, std::string::size_type end)
: allow_empty(ae)
, separator(sep)
, string(str, start, end)