From 75e05bc441382db69c842a64c562738cb749214e Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 22 Jan 2023 13:56:55 -0500 Subject: add upstream 12.0 --- zen/string_tools.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'zen/string_tools.h') diff --git a/zen/string_tools.h b/zen/string_tools.h index 3975cc92..ca086efd 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -53,7 +53,6 @@ struct StringHashAsciiNoCase; struct StringEqualAsciiNoCase; template Num hashString(const S& str); -template Num appendHashString(Num hashVal, const S& str); enum class IfNotFoundReturn { @@ -315,7 +314,7 @@ bool contains(const S& str, const T& term) const auto* const strFirst = strBegin(str); const auto* const strLast = strFirst + strLen; const auto* const termFirst = strBegin(term); - + return searchFirst(strFirst, strLast, termFirst, termFirst + termLen) != strLast; } @@ -331,7 +330,7 @@ S afterLast(const S& str, const T& term, IfNotFoundReturn infr) const auto* const strFirst = strBegin(str); const auto* const strLast = strFirst + strLength(str); const auto* const termFirst = strBegin(term); - + const auto* it = searchLast(strFirst, strLast, termFirst, termFirst + termLen); if (it == strLast) @@ -348,7 +347,7 @@ S beforeLast(const S& str, const T& term, IfNotFoundReturn infr) static_assert(std::is_same_v, GetCharTypeT>); const size_t termLen = strLength(term); assert(termLen > 0); - + const auto* const strFirst = strBegin(str); const auto* const strLast = strFirst + strLength(str); const auto* const termFirst = strBegin(term); @@ -372,7 +371,7 @@ S afterFirst(const S& str, const T& term, IfNotFoundReturn infr) const auto* const strFirst = strBegin(str); const auto* const strLast = strFirst + strLength(str); const auto* const termFirst = strBegin(term); - + const auto* it = searchFirst(strFirst, strLast, termFirst, termFirst + termLen); if (it == strLast) @@ -393,7 +392,7 @@ S beforeFirst(const S& str, const T& term, IfNotFoundReturn infr) const auto* const strFirst = strBegin(str); const auto* const strLast = strFirst + strLength(str); const auto* const termFirst = strBegin(term); - + auto it = searchFirst(strFirst, strLast, termFirst, termFirst + termLen); if (it == strLast) @@ -642,7 +641,7 @@ S printNumber(const T& format, const Num& number) //format a single number using #error refactor? #endif static_assert(std::is_same_v, GetCharTypeT>); - assert(strBegin(format)[strLength(format)] == 0); //format must be null-terminated! + assert(strBegin(format)[strLength(format)] == 0); //format must be null-terminated! S buf(128, static_cast>('0')); const int charsWritten = impl::saferPrintf(buf.data(), buf.size(), strBegin(format), number); -- cgit