diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:23 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:23 +0300 |
commit | 706b83ed7de5a473436620367af31fc0ceecde07 (patch) | |
tree | 103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/diff | |
parent | 918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff) | |
download | ydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/diff')
-rw-r--r-- | library/cpp/diff/diff.cpp | 8 | ||||
-rw-r--r-- | library/cpp/diff/diff.h | 8 | ||||
-rw-r--r-- | library/cpp/diff/diff_ut.cpp | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/diff/diff.cpp b/library/cpp/diff/diff.cpp index be57da7f39..581afc29ac 100644 --- a/library/cpp/diff/diff.cpp +++ b/library/cpp/diff/diff.cpp @@ -7,8 +7,8 @@ template <typename T> struct TCollectionImpl { - TVector<TConstArrayRef<T>> Words; - TVector<ui64> Keys; + TVector<TConstArrayRef<T>> Words; + TVector<ui64> Keys; inline bool Consume(const T* b, const T* e, const T*) { if (b < e) { @@ -64,7 +64,7 @@ size_t NDiff::InlineDiff(TVector<TChunk<char>>& chunks, const TStringBuf& left, } TCollection<char> c1(left, delims); TCollection<char> c2(right, delims); - TVector<TChunk<ui64>> diff; + TVector<TChunk<ui64>> diff; const size_t dist = InlineDiff<ui64>(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk<char>(c1.Remap(it.Left), c2.Remap(it.Right), c1.Remap(it.Common))); @@ -78,7 +78,7 @@ size_t NDiff::InlineDiff(TVector<TChunk<wchar16>>& chunks, const TWtringBuf& lef } TCollection<wchar16> c1(left, delims); TCollection<wchar16> c2(right, delims); - TVector<TChunk<ui64>> diff; + TVector<TChunk<ui64>> diff; const size_t dist = InlineDiff<ui64>(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk<wchar16>(c1.Remap(it.Left), c2.Remap(it.Right), c1.Remap(it.Common))); diff --git a/library/cpp/diff/diff.h b/library/cpp/diff/diff.h index 94fb00cd0b..5a4f2e4314 100644 --- a/library/cpp/diff/diff.h +++ b/library/cpp/diff/diff.h @@ -3,7 +3,7 @@ #include <library/cpp/lcs/lcs_via_lis.h> #include <util/generic/algorithm.h> -#include <util/generic/array_ref.h> +#include <util/generic/array_ref.h> #include <util/generic/strbuf.h> #include <util/generic/vector.h> #include <util/stream/output.h> @@ -39,7 +39,7 @@ namespace NDiff { swapped = true; } - TVector<T> lcs; + TVector<T> lcs; NLCS::TLCSCtx<T> ctx; NLCS::MakeLCS<T>(s1, s2, &lcs, &ctx); @@ -91,8 +91,8 @@ namespace NDiff { } template <typename TFormatter, typename T> - void PrintChunks(IOutputStream& out, const TFormatter& fmt, const TVector<TChunk<T>>& chunks) { - for (typename TVector<TChunk<T>>::const_iterator chunk = chunks.begin(); chunk != chunks.end(); ++chunk) { + void PrintChunks(IOutputStream& out, const TFormatter& fmt, const TVector<TChunk<T>>& chunks) { + for (typename TVector<TChunk<T>>::const_iterator chunk = chunks.begin(); chunk != chunks.end(); ++chunk) { if (!chunk->Left.empty() || !chunk->Right.empty()) { out << fmt.Special("("); out << fmt.Left(chunk->Left); diff --git a/library/cpp/diff/diff_ut.cpp b/library/cpp/diff/diff_ut.cpp index b82a7b000e..d409faf4e3 100644 --- a/library/cpp/diff/diff_ut.cpp +++ b/library/cpp/diff/diff_ut.cpp @@ -6,7 +6,7 @@ using namespace NDiff; struct TDiffTester { TStringStream Res; - TVector<TChunk<char>> Chunks; + TVector<TChunk<char>> Chunks; TStringBuf Special(const TStringBuf& str) const { return str; @@ -24,14 +24,14 @@ struct TDiffTester { return TStringBuf(str.begin(), str.end()); } - void Test(const TStringBuf& a, const TStringBuf& b, const TString& delims = " \t\n") { + void Test(const TStringBuf& a, const TStringBuf& b, const TString& delims = " \t\n") { Chunks.clear(); InlineDiff(Chunks, a, b, delims); Res.clear(); PrintChunks(Res, *this, Chunks); } - const TString& Result() const { + const TString& Result() const { return Res.Str(); } }; |