diff options
author | dprokoptsev <dprokoptsev@yandex-team.ru> | 2022-02-10 16:50:05 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:05 +0300 |
commit | 94e596fdab09d4aeb51a3d27767959d8ed030a3d (patch) | |
tree | 9efd85ff3b6369cf556bfb78b67b233e11d02ff6 /util/string | |
parent | 64407caacb4d68aeabc6afe1ddd28750bf7522f4 (diff) | |
download | ydb-94e596fdab09d4aeb51a3d27767959d8ed030a3d.tar.gz |
Restoring authorship annotation for <dprokoptsev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string')
-rw-r--r-- | util/string/vector.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/util/string/vector.h b/util/string/vector.h index e36c348bbe..c706b320b0 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); |