diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/deprecated/kmp | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 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 d02074c94a..c2a35a2878 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 a7f72eece6..85090f6b2b 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 c2eda83c57..f3bcf8f4a6 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; } |