diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:10 +0300 |
commit | baa58daefa91fde4b4769facdbd2903763b9c6a8 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/deprecated/kmp | |
parent | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (diff) | |
download | ydb-baa58daefa91fde4b4769facdbd2903763b9c6a8.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/deprecated/kmp')
-rw-r--r-- | library/cpp/deprecated/kmp/kmp.cpp | 2 | ||||
-rw-r--r-- | library/cpp/deprecated/kmp/kmp.h | 10 | ||||
-rw-r--r-- | library/cpp/deprecated/kmp/kmp_ut.cpp | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/library/cpp/deprecated/kmp/kmp.cpp b/library/cpp/deprecated/kmp/kmp.cpp index c2a35a2878..d02074c94a 100644 --- a/library/cpp/deprecated/kmp/kmp.cpp +++ b/library/cpp/deprecated/kmp/kmp.cpp @@ -16,6 +16,6 @@ TKMPMatcher::TKMPMatcher(const TString& pattern) void TKMPMatcher::ComputePrefixFunction() { ssize_t* pf; - ::ComputePrefixFunction(Pattern.data(), Pattern.data() + Pattern.size(), &pf); + ::ComputePrefixFunction(Pattern.data(), Pattern.data() + Pattern.size(), &pf); PrefixFunction.Reset(pf); } diff --git a/library/cpp/deprecated/kmp/kmp.h b/library/cpp/deprecated/kmp/kmp.h index 85090f6b2b..a7f72eece6 100644 --- a/library/cpp/deprecated/kmp/kmp.h +++ b/library/cpp/deprecated/kmp/kmp.h @@ -42,7 +42,7 @@ public: bool SubStr(const char* begin, const char* end, const char*& result) const { Y_ASSERT(begin <= end); - ssize_t m = Pattern.size(); + ssize_t m = Pattern.size(); ssize_t n = end - begin; ssize_t i, j; for (i = 0, j = 0; (i < n) && (j < m); ++i, ++j) { @@ -80,7 +80,7 @@ public: : Callback(callback) , Pattern(patternBegin, patternEnd) , State(0) - , Candidate(Pattern.size()) + , Candidate(Pattern.size()) { ssize_t* pf; ComputePrefixFunction(patternBegin, patternEnd, &pf); @@ -89,14 +89,14 @@ public: void Push(const T& symbol) { while ((State >= 0) && (Pattern[State] != symbol)) { - Y_ASSERT(State <= (ssize_t) Pattern.size()); + Y_ASSERT(State <= (ssize_t) Pattern.size()); State = PrefixFunction[State]; - Y_ASSERT(State <= (ssize_t) Pattern.size()); + Y_ASSERT(State <= (ssize_t) Pattern.size()); } if (State >= 0) Candidate[State] = symbol; ++State; - if (State == (ssize_t) Pattern.size()) { + if (State == (ssize_t) Pattern.size()) { Callback->OnMatch(Candidate.begin(), Candidate.end()); State = 0; } diff --git a/library/cpp/deprecated/kmp/kmp_ut.cpp b/library/cpp/deprecated/kmp/kmp_ut.cpp index f3bcf8f4a6..c2eda83c57 100644 --- a/library/cpp/deprecated/kmp/kmp_ut.cpp +++ b/library/cpp/deprecated/kmp/kmp_ut.cpp @@ -11,8 +11,8 @@ static TVector<int> FindAll(const TString& pattern, const TString& string) { const char* begin = string.begin(); const char* end = string.end(); while (kmp.SubStr(begin, end, pResult)) { - result.push_back(int(pResult - string.data())); - begin = pResult + pattern.size(); + result.push_back(int(pResult - string.data())); + begin = pResult + pattern.size(); } return result; } |