aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/util.h
diff options
context:
space:
mode:
authoraosipenko <aosipenko@yandex-team.ru>2022-02-10 16:48:08 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:08 +0300
commit948fd24d47d4b3b7815aaef1686aea00ef3f4288 (patch)
tree8ad4c39c2a5f8b341bc02e3b0c5e8f26c40373cb /util/string/util.h
parentd2eb4aae699fa2f6901bf32d22eec019c8f29838 (diff)
downloadydb-948fd24d47d4b3b7815aaef1686aea00ef3f4288.tar.gz
Restoring authorship annotation for <aosipenko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/util.h')
-rw-r--r--util/string/util.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/util/string/util.h b/util/string/util.h
index 0d77a5042b..1e173ab75f 100644
--- a/util/string/util.h
+++ b/util/string/util.h
@@ -4,7 +4,7 @@
#include <cstring>
#include <cstdarg>
-#include <algorithm>
+#include <algorithm>
#include <util/system/defaults.h>
#include <util/generic/string.h>
@@ -13,7 +13,7 @@
/// @addtogroup Strings_Miscellaneous
/// @{
int a2i(const TString& s);
-
+
/// Removes the last character if it is equal to c.
template <class T>
inline void RemoveIfLast(T& s, int c) {
@@ -170,7 +170,7 @@ public:
*dst = 0;
}
void Do(char* s, size_t l) const {
- for (size_t i = 0; i < l && s[i]; i++)
+ for (size_t i = 0; i < l && s[i]; i++)
s[i] = ConvertChar(s[i]);
}
void Do(TString& str) const;
@@ -180,16 +180,16 @@ private:
size_t FindFirstChangePosition(const TString& str) const;
};
-
-// Removes all occurrences of given character from string
+
+// 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()'
if (pos == TStringType::npos)
- return;
-
+ return;
+
typename TStringType::iterator begin = str.begin();
typename TStringType::iterator end = begin + str.length();
typename TStringType::iterator it = std::remove(begin + pos, end, ch);
- str.erase(it, end);
-}
+ str.erase(it, end);
+}