aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/vector.h
diff options
context:
space:
mode:
authordprokoptsev <dprokoptsev@yandex-team.ru>2022-02-10 16:50:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:05 +0300
commitcf94099c3ea704df29c11dfb77e2adec41a6708d (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/string/vector.h
parent94e596fdab09d4aeb51a3d27767959d8ed030a3d (diff)
downloadydb-cf94099c3ea704df29c11dfb77e2adec41a6708d.tar.gz
Restoring authorship annotation for <dprokoptsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/string/vector.h')
-rw-r--r--util/string/vector.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/util/string/vector.h b/util/string/vector.h
index c706b320b0..e36c348bbe 100644
--- a/util/string/vector.h
+++ b/util/string/vector.h
@@ -68,19 +68,19 @@ SplitString(const typename ::NPrivate::TStringDeducer<C>::type& str, const C* de
template <class TIter>
inline TString JoinStrings(TIter begin, TIter end, const TStringBuf delim) {
- if (begin == end)
+ if (begin == end)
return TString();
TString result = ToString(*begin);
- for (++begin; begin != end; ++begin) {
- result.append(delim);
+ for (++begin; begin != end; ++begin) {
+ result.append(delim);
result.append(ToString(*begin));
- }
+ }
+
+ return result;
+}
- return result;
-}
-
template <class TIter>
inline TUtf16String JoinStrings(TIter begin, TIter end, const TWtringBuf delim) {
if (begin == end)
@@ -99,13 +99,13 @@ inline TUtf16String JoinStrings(TIter begin, TIter end, const TWtringBuf delim)
/// Concatenates elements of given TVector<TString>.
inline TString JoinStrings(const TVector<TString>& v, const TStringBuf delim) {
return JoinStrings(v.begin(), v.end(), delim);
-}
-
+}
+
inline TString JoinStrings(const TVector<TString>& v, size_t index, size_t count, const TStringBuf delim) {
Y_ASSERT(index + count <= v.size() && "JoinStrings(): index or count out of range");
return JoinStrings(v.begin() + index, v.begin() + index + count, delim);
-}
-
+}
+
template <typename T>
inline TString JoinVectorIntoString(const TVector<T>& v, const TStringBuf delim) {
return JoinStrings(v.begin(), v.end(), delim);