aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/vector.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/string/vector.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/vector.h')
-rw-r--r--util/string/vector.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/util/string/vector.h b/util/string/vector.h
index e36c348bbe..fc8c78e2e2 100644
--- a/util/string/vector.h
+++ b/util/string/vector.h
@@ -10,7 +10,7 @@
#include <util/string/cast.h>
#include <util/system/yassert.h>
-#define KEEP_EMPTY_TOKENS 0x01
+#define KEEP_EMPTY_TOKENS 0x01
//
// NOTE: Check StringSplitter below to get more convenient split string interface.
@@ -66,36 +66,36 @@ SplitString(const typename ::NPrivate::TStringDeducer<C>::type& str, const C* de
return SplitString(str.data(), str.size(), delimiter, maxFields, options);
}
-template <class TIter>
+template <class TIter>
inline TString JoinStrings(TIter begin, TIter end, const TStringBuf delim) {
if (begin == end)
return TString();
-
+
TString result = ToString(*begin);
-
+
for (++begin; begin != end; ++begin) {
result.append(delim);
- result.append(ToString(*begin));
+ result.append(ToString(*begin));
}
-
+
return result;
}
-template <class TIter>
+template <class TIter>
inline TUtf16String JoinStrings(TIter begin, TIter end, const TWtringBuf delim) {
- if (begin == end)
+ if (begin == end)
return TUtf16String();
-
+
TUtf16String result = ToWtring(*begin);
-
- for (++begin; begin != end; ++begin) {
- result.append(delim);
- result.append(ToWtring(*begin));
- }
-
- return result;
-}
-
+
+ for (++begin; begin != end; ++begin) {
+ result.append(delim);
+ result.append(ToWtring(*begin));
+ }
+
+ return result;
+}
+
/// Concatenates elements of given TVector<TString>.
inline TString JoinStrings(const TVector<TString>& v, const TStringBuf delim) {
return JoinStrings(v.begin(), v.end(), delim);
@@ -125,7 +125,7 @@ template <typename T, typename TStringType>
TVector<T> Scan(const TVector<TStringType>& input) {
TVector<T> output;
output.reserve(input.size());
- for (int i = 0; i < input.ysize(); ++i) {
+ for (int i = 0; i < input.ysize(); ++i) {
output.push_back(FromString<T>(input[i]));
}
return output;