diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/string/util.h | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r-- | util/string/util.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/util/string/util.h b/util/string/util.h index 4108a1389a..0d77a5042b 100644 --- a/util/string/util.h +++ b/util/string/util.h @@ -7,12 +7,12 @@ #include <algorithm> #include <util/system/defaults.h> -#include <util/generic/string.h> +#include <util/generic/string.h> #include <util/generic/strbuf.h> /// @addtogroup Strings_Miscellaneous /// @{ -int a2i(const TString& s); +int a2i(const TString& s); /// Removes the last character if it is equal to c. template <class T> @@ -23,7 +23,7 @@ inline void RemoveIfLast(T& s, int c) { } /// Adds lastCh symbol to the the of the string if it is not already there. -inline void addIfNotLast(TString& s, int lastCh) { +inline void addIfNotLast(TString& s, int lastCh) { size_t len = s.length(); if (!len || s[len - 1] != lastCh) { s.append(char(lastCh)); @@ -33,9 +33,9 @@ inline void addIfNotLast(TString& s, int lastCh) { /// @details Finishes the string with lastCh1 if lastCh2 is not present in the string and lastCh1 is not already at the end of the string. /// Else, if lastCh2 is not equal to the symbol before the last, it finishes the string with lastCh2. /// @todo ?? Define, when to apply the function. Is in use several times for URLs parsing. -inline void addIfAbsent(TString& s, char lastCh1, char lastCh2) { +inline void addIfAbsent(TString& s, char lastCh1, char lastCh2) { size_t pos = s.find(lastCh2); - if (pos == TString::npos) { + if (pos == TString::npos) { //s.append((char)lastCh1); addIfNotLast(s, lastCh1); } else if (pos < s.length() - 1) { @@ -173,18 +173,18 @@ public: for (size_t i = 0; i < l && s[i]; i++) s[i] = ConvertChar(s[i]); } - void Do(TString& str) const; + void Do(TString& str) const; private: char Map[256]; - size_t FindFirstChangePosition(const TString& str) const; + size_t FindFirstChangePosition(const TString& str) const; }; // Removes all occurrences of given character from string template <typename TStringType> void RemoveAll(TStringType& str, typename TStringType::char_type ch) { - size_t pos = str.find(ch); // 'find' to avoid cloning of string in 'TString.begin()' + size_t pos = str.find(ch); // 'find' to avoid cloning of string in 'TString.begin()' if (pos == TStringType::npos) return; |