diff options
author | dobrokot <dobrokot@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:07 +0300 |
commit | 25d83bf841d8b3ce3886525078f1964ac3c293c5 (patch) | |
tree | bd52fa16c8dd727890b2ef9d87d1a402bd0d3a9a /library/cpp/deprecated/split | |
parent | 1d2e8a8e9976488ea69a7e4763aa749244f82612 (diff) | |
download | ydb-25d83bf841d8b3ce3886525078f1964ac3c293c5.tar.gz |
Restoring authorship annotation for <dobrokot@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/deprecated/split')
-rw-r--r-- | library/cpp/deprecated/split/delim_string_iter.h | 24 | ||||
-rw-r--r-- | library/cpp/deprecated/split/delim_string_iter_ut.cpp | 14 |
2 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/deprecated/split/delim_string_iter.h b/library/cpp/deprecated/split/delim_string_iter.h index 8e4ca171a0..5bf1348bcc 100644 --- a/library/cpp/deprecated/split/delim_string_iter.h +++ b/library/cpp/deprecated/split/delim_string_iter.h @@ -136,26 +136,26 @@ private: TStringBuf Delim; }; -//example: for (TStringBuf field: TDelimStroka(line, "@@")) { ... } +//example: for (TStringBuf field: TDelimStroka(line, "@@")) { ... } struct TDelimStroka { - TStringBuf S; - TStringBuf Delim; - + TStringBuf S; + TStringBuf Delim; + inline TDelimStroka(TStringBuf s, TStringBuf delim) - : S(s) - , Delim(delim) + : S(s) + , Delim(delim) { } - + inline TDelimStringIter begin() const { return TDelimStringIter(S, Delim); - } - + } + inline TDelimStringIter end() const { return TDelimStringIter(); - } -}; - + } +}; + inline TDelimStringIter begin_delim(const TString& str, TStringBuf delim) { return TDelimStringIter(str, delim); } diff --git a/library/cpp/deprecated/split/delim_string_iter_ut.cpp b/library/cpp/deprecated/split/delim_string_iter_ut.cpp index 18a8b2a160..c9d94b4a1d 100644 --- a/library/cpp/deprecated/split/delim_string_iter_ut.cpp +++ b/library/cpp/deprecated/split/delim_string_iter_ut.cpp @@ -38,17 +38,17 @@ Y_UNIT_TEST_SUITE(TDelimStrokaIterTestSuite) { ++it; UNIT_ASSERT_STRINGS_EQUAL(it.Cdr(), ""); } - + Y_UNIT_TEST(ForIter) { TVector<TStringBuf> expected = {"1", "", "3@4", ""}; TVector<TStringBuf> got; - + for (TStringBuf x : TDelimStroka("1@@@@3@4@@", "@@")) { - got.push_back(x); - } - - UNIT_ASSERT_EQUAL(got, expected); - } + got.push_back(x); + } + + UNIT_ASSERT_EQUAL(got, expected); + } } static void AssertKeyValueStringSplit( |