From 344ea37b4a345701ab0e67de2266a1c1bd7baf2d Mon Sep 17 00:00:00 2001 From: Vlad Yaroslavlev Date: Thu, 10 Feb 2022 16:46:25 +0300 Subject: Restoring authorship annotation for Vlad Yaroslavlev . Commit 2 of 2. --- library/cpp/diff/diff.cpp | 8 ++++---- library/cpp/diff/diff.h | 8 ++++---- library/cpp/diff/diff_ut.cpp | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'library/cpp/diff') diff --git a/library/cpp/diff/diff.cpp b/library/cpp/diff/diff.cpp index 581afc29ac1..be57da7f396 100644 --- a/library/cpp/diff/diff.cpp +++ b/library/cpp/diff/diff.cpp @@ -7,8 +7,8 @@ template struct TCollectionImpl { - TVector> Words; - TVector Keys; + TVector> Words; + TVector Keys; inline bool Consume(const T* b, const T* e, const T*) { if (b < e) { @@ -64,7 +64,7 @@ size_t NDiff::InlineDiff(TVector>& chunks, const TStringBuf& left, } TCollection c1(left, delims); TCollection c2(right, delims); - TVector> diff; + TVector> diff; const size_t dist = InlineDiff(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk(c1.Remap(it.Left), c2.Remap(it.Right), c1.Remap(it.Common))); @@ -78,7 +78,7 @@ size_t NDiff::InlineDiff(TVector>& chunks, const TWtringBuf& lef } TCollection c1(left, delims); TCollection c2(right, delims); - TVector> diff; + TVector> diff; const size_t dist = InlineDiff(diff, c1.GetKeys(), c2.GetKeys()); for (const auto& it : diff) { chunks.push_back(TChunk(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 5a4f2e43141..94fb00cd0b3 100644 --- a/library/cpp/diff/diff.h +++ b/library/cpp/diff/diff.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include @@ -39,7 +39,7 @@ namespace NDiff { swapped = true; } - TVector lcs; + TVector lcs; NLCS::TLCSCtx ctx; NLCS::MakeLCS(s1, s2, &lcs, &ctx); @@ -91,8 +91,8 @@ namespace NDiff { } template - void PrintChunks(IOutputStream& out, const TFormatter& fmt, const TVector>& chunks) { - for (typename TVector>::const_iterator chunk = chunks.begin(); chunk != chunks.end(); ++chunk) { + void PrintChunks(IOutputStream& out, const TFormatter& fmt, const TVector>& chunks) { + for (typename TVector>::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 d409faf4e3e..b82a7b000ee 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> Chunks; + TVector> 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(); } }; -- cgit v1.3