aboutsummaryrefslogtreecommitdiffstats
path: root/util/string
diff options
context:
space:
mode:
authorkrock21 <krock21@yandex-team.ru>2022-02-10 16:46:02 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:02 +0300
commit937a6bb8d7c82d8d9d717f2bf6ce6c592a443641 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/string
parent4aae166b5d23fd02653919f43e2015cd636fa6fd (diff)
downloadydb-937a6bb8d7c82d8d9d717f2bf6ce6c592a443641.tar.gz
Restoring authorship annotation for <krock21@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string')
-rw-r--r--util/string/ascii.cpp12
-rw-r--r--util/string/ascii.h16
-rw-r--r--util/string/vector.cpp20
3 files changed, 24 insertions, 24 deletions
diff --git a/util/string/ascii.cpp b/util/string/ascii.cpp
index bec423539b..95edb95cc8 100644
--- a/util/string/ascii.cpp
+++ b/util/string/ascii.cpp
@@ -43,16 +43,16 @@ extern const unsigned char NPrivate::ASCII_LOWER[256] = {
};
// clang-format on
-int AsciiCompareIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
- if (s1.size() <= s2.size()) {
- if (int cmp = strnicmp(s1.data(), s2.data(), s1.size())) {
+int AsciiCompareIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
+ if (s1.size() <= s2.size()) {
+ if (int cmp = strnicmp(s1.data(), s2.data(), s1.size())) {
return cmp;
}
- return (s1.size() < s2.size()) ? -1 : 0;
+ return (s1.size() < s2.size()) ? -1 : 0;
}
- Y_ASSERT(s1.size() > s2.size());
- if (int cmp = strnicmp(s1.data(), s2.data(), s2.size())) {
+ Y_ASSERT(s1.size() > s2.size());
+ if (int cmp = strnicmp(s1.data(), s2.data(), s2.size())) {
return cmp;
}
return 1;
diff --git a/util/string/ascii.h b/util/string/ascii.h
index ac63cafa66..10344384d3 100644
--- a/util/string/ascii.h
+++ b/util/string/ascii.h
@@ -179,8 +179,8 @@ static inline bool AsciiEqualsIgnoreCase(const char* s1, const char* s2) noexcep
*
* @return true iff @c s1 ans @c s2 are case-insensitively equal.
*/
-static inline bool AsciiEqualsIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
- return (s1.size() == s2.size()) && strnicmp(s1.data(), s2.data(), s1.size()) == 0;
+static inline bool AsciiEqualsIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
+ return (s1.size() == s2.size()) && strnicmp(s1.data(), s2.data(), s1.size()) == 0;
}
/**
@@ -222,8 +222,8 @@ Y_PURE_FUNCTION int AsciiCompareIgnoreCase(const TStringBuf s1, const TStringBuf
*
* @return true iff @c s2 are case-sensitively prefix of @c s1.
*/
-static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noexcept {
- return (s1.size() >= s2.size()) && memcmp(s1.data(), s2.data(), s2.size()) == 0;
+static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noexcept {
+ return (s1.size() >= s2.size()) && memcmp(s1.data(), s2.data(), s2.size()) == 0;
}
/**
@@ -232,8 +232,8 @@ static inline bool AsciiHasPrefix(const TStringBuf s1, const TStringBuf s2) noex
*
* @return true iff @c s2 are case-insensitively prefix of @c s1.
*/
-static inline bool AsciiHasPrefixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
- return (s1.size() >= s2.size()) && strnicmp(s1.data(), s2.data(), s2.size()) == 0;
+static inline bool AsciiHasPrefixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
+ return (s1.size() >= s2.size()) && strnicmp(s1.data(), s2.data(), s2.size()) == 0;
}
/**
@@ -242,6 +242,6 @@ static inline bool AsciiHasPrefixIgnoreCase(const TStringBuf s1, const TStringBu
*
* @return true iff @c s2 are case-insensitively suffix of @c s1.
*/
-static inline bool AsciiHasSuffixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
- return (s1.size() >= s2.size()) && strnicmp((s1.data() + (s1.size() - s2.size())), s2.data(), s2.size()) == 0;
+static inline bool AsciiHasSuffixIgnoreCase(const TStringBuf s1, const TStringBuf s2) noexcept {
+ return (s1.size() >= s2.size()) && strnicmp((s1.data() + (s1.size() - s2.size())), s2.data(), s2.size()) == 0;
}
diff --git a/util/string/vector.cpp b/util/string/vector.cpp
index 5bb5fbfe3b..9ba401f0a2 100644
--- a/util/string/vector.cpp
+++ b/util/string/vector.cpp
@@ -5,12 +5,12 @@
#include <util/system/defaults.h>
template <class TConsumer, class TDelim, typename TChr>
-static inline void DoSplit2(TConsumer& c, TDelim& d, const TBasicStringBuf<TChr> str, int) {
- SplitString(str.data(), str.data() + str.size(), d, c);
+static inline void DoSplit2(TConsumer& c, TDelim& d, const TBasicStringBuf<TChr> str, int) {
+ SplitString(str.data(), str.data() + str.size(), d, c);
}
template <class TConsumer, class TDelim, typename TChr>
-static inline void DoSplit1(TConsumer& cc, TDelim& d, const TBasicStringBuf<TChr> str, int opts) {
+static inline void DoSplit1(TConsumer& cc, TDelim& d, const TBasicStringBuf<TChr> str, int opts) {
if (opts & KEEP_EMPTY_TOKENS) {
DoSplit2(cc, d, str, opts);
} else {
@@ -21,11 +21,11 @@ static inline void DoSplit1(TConsumer& cc, TDelim& d, const TBasicStringBuf<TChr
}
template <class C, class TDelim, typename TChr>
-static inline void DoSplit0(C* res, const TBasicStringBuf<TChr> str, TDelim& d, size_t maxFields, int options) {
+static inline void DoSplit0(C* res, const TBasicStringBuf<TChr> str, TDelim& d, size_t maxFields, int options) {
using TStringType = std::conditional_t<std::is_same<TChr, wchar16>::value, TUtf16String, TString>;
res->clear();
- if (!str.data()) {
+ if (!str.data()) {
return;
}
@@ -38,7 +38,7 @@ static inline void DoSplit0(C* res, const TBasicStringBuf<TChr> str, TDelim& d,
DoSplit1(lc, d, str, options);
if (lc.Last) {
- res->push_back(TStringType(lc.Last, str.data() + str.size() - lc.Last));
+ res->push_back(TStringType(lc.Last, str.data() + str.size() - lc.Last));
}
} else {
DoSplit1(cc, d, str, options);
@@ -64,19 +64,19 @@ static void SplitStringImplT(TVector<std::conditional_t<std::is_same<TChr, wchar
}
void ::NPrivate::SplitStringImpl(TVector<TString>* res, const char* ptr, const char* delim, size_t maxFields, int options) {
- return SplitStringImplT<char>(res, TStringBuf(ptr), delim, maxFields, options);
+ return SplitStringImplT<char>(res, TStringBuf(ptr), delim, maxFields, options);
}
void ::NPrivate::SplitStringImpl(TVector<TString>* res, const char* ptr, size_t len, const char* delim, size_t maxFields, int options) {
- return SplitStringImplT<char>(res, TStringBuf(ptr, len), delim, maxFields, options);
+ return SplitStringImplT<char>(res, TStringBuf(ptr, len), delim, maxFields, options);
}
void ::NPrivate::SplitStringImpl(TVector<TUtf16String>* res, const wchar16* ptr, const wchar16* delimiter, size_t maxFields, int options) {
- return SplitStringImplT<wchar16>(res, TWtringBuf(ptr), delimiter, maxFields, options);
+ return SplitStringImplT<wchar16>(res, TWtringBuf(ptr), delimiter, maxFields, options);
}
void ::NPrivate::SplitStringImpl(TVector<TUtf16String>* res, const wchar16* ptr, size_t len, const wchar16* delimiter, size_t maxFields, int options) {
- return SplitStringImplT<wchar16>(res, TWtringBuf(ptr, len), delimiter, maxFields, options);
+ return SplitStringImplT<wchar16>(res, TWtringBuf(ptr, len), delimiter, maxFields, options);
}
TUtf16String JoinStrings(const TVector<TUtf16String>& v, const TWtringBuf delim) {