diff options
author | onpopov <onpopov@yandex-team.ru> | 2022-02-10 16:50:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:38 +0300 |
commit | 84a29dd4980d5b39615e453f289bd1a81213296d (patch) | |
tree | 5e320f10d6b5863e0d5ab1a8caa9eefbdaa5195f /util/string/util.h | |
parent | 1717072c6635948128dad7b015a0ec05acbe913b (diff) | |
download | ydb-84a29dd4980d5b39615e453f289bd1a81213296d.tar.gz |
Restoring authorship annotation for <onpopov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r-- | util/string/util.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/string/util.h b/util/string/util.h index 0d77a5042b..2ecafeaae3 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -152,32 +152,32 @@ protected: }; // an analogue of tr/$from/$to/ -class Tr { -public: +class Tr { +public: Tr(const char* from, const char* to); - - char ConvertChar(char ch) const { - return Map[(ui8)ch]; - } - + + char ConvertChar(char ch) const { + return Map[(ui8)ch]; + } + void Do(char* s) const { for (; *s; s++) - *s = ConvertChar(*s); + *s = ConvertChar(*s); } void Do(const char* src, char* dst) const { for (; *src; src++) - *dst++ = ConvertChar(*src); + *dst++ = ConvertChar(*src); *dst = 0; } void Do(char* s, size_t l) const { for (size_t i = 0; i < l && s[i]; i++) - s[i] = ConvertChar(s[i]); + s[i] = ConvertChar(s[i]); } void Do(TString& str) const; - -private: - char Map[256]; - + +private: + char Map[256]; + size_t FindFirstChangePosition(const TString& str) const; }; |