diff options
author | krock21 <krock21@yandex-team.ru> | 2022-02-10 16:46:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:02 +0300 |
commit | 937a6bb8d7c82d8d9d717f2bf6ce6c592a443641 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/charset/ci_string.h | |
parent | 4aae166b5d23fd02653919f43e2015cd636fa6fd (diff) | |
download | ydb-937a6bb8d7c82d8d9d717f2bf6ce6c592a443641.tar.gz |
Restoring authorship annotation for <krock21@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/charset/ci_string.h')
-rw-r--r-- | library/cpp/charset/ci_string.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/charset/ci_string.h b/library/cpp/charset/ci_string.h index 2c61f5ca76..edf24c1b6f 100644 --- a/library/cpp/charset/ci_string.h +++ b/library/cpp/charset/ci_string.h @@ -51,7 +51,7 @@ public: { } - explicit TCiString(const TStringBuf& s) + explicit TCiString(const TStringBuf& s) : TString(s) { } @@ -60,17 +60,17 @@ public: static int compare(const TCiString& s1, const TCiString& s2, const CodePage& cp = csYandex); static int compare(const char* p, const TCiString& s2, const CodePage& cp = csYandex); static int compare(const TCiString& s1, const char* p, const CodePage& cp = csYandex); - static int compare(const TStringBuf& p1, const TStringBuf& p2, const CodePage& cp = csYandex); + static int compare(const TStringBuf& p1, const TStringBuf& p2, const CodePage& cp = csYandex); // TODO: implement properly in TString via enum ECaseSensitivity - static bool is_prefix(const TStringBuf& what, const TStringBuf& of, const CodePage& cp = csYandex); - static bool is_suffix(const TStringBuf& what, const TStringBuf& of, const CodePage& cp = csYandex); + static bool is_prefix(const TStringBuf& what, const TStringBuf& of, const CodePage& cp = csYandex); + static bool is_suffix(const TStringBuf& what, const TStringBuf& of, const CodePage& cp = csYandex); - bool StartsWith(const TStringBuf& s, const CodePage& cp = csYandex) const { + bool StartsWith(const TStringBuf& s, const CodePage& cp = csYandex) const { return is_prefix(s, *this, cp); } - bool EndsWith(const TStringBuf& s, const CodePage& cp = csYandex) const { + bool EndsWith(const TStringBuf& s, const CodePage& cp = csYandex) const { return is_suffix(s, *this, cp); } @@ -217,8 +217,8 @@ struct ci_hash { inline size_t operator()(const char* s) const { return TCiString::hashVal(s, strlen(s)); } - inline size_t operator()(const TStringBuf& s) const { - return TCiString::hashVal(s.data(), s.size()); + inline size_t operator()(const TStringBuf& s) const { + return TCiString::hashVal(s.data(), s.size()); } }; @@ -240,8 +240,8 @@ struct TCIHash { template <> struct TCIHash<const char*> { - inline size_t operator()(const TStringBuf& s) const { - return TCiString::hashVal(s.data(), s.size()); + inline size_t operator()(const TStringBuf& s) const { + return TCiString::hashVal(s.data(), s.size()); } }; @@ -270,8 +270,8 @@ struct ci_equal_to { return csYandex.stricmp(x, y) == 0; } // this implementation is not suitable for strings with zero characters inside, sorry - bool operator()(const TStringBuf& x, const TStringBuf& y) const { - return x.size() == y.size() && csYandex.strnicmp(x.data(), y.data(), y.size()) == 0; + bool operator()(const TStringBuf& x, const TStringBuf& y) const { + return x.size() == y.size() && csYandex.strnicmp(x.data(), y.data(), y.size()) == 0; } }; |