diff options
| author | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
|---|---|---|
| committer | MZuenni <michi.zuendorf@gmail.com> | 2023-03-01 11:36:26 +0100 |
| commit | 12afe719ce268bb10aa93a910079a44eb08999b8 (patch) | |
| tree | 0937a117287eebe3942e0506d27143eff4980d09 /string/ahoCorasick.cpp | |
| parent | ad8456f7c5d44d3c647b3a368050a5d2f39ae3c3 (diff) | |
removed trailing whitespaces and use more structured bindings
Diffstat (limited to 'string/ahoCorasick.cpp')
| -rw-r--r-- | string/ahoCorasick.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/string/ahoCorasick.cpp b/string/ahoCorasick.cpp index c83f9c3..9ffa6c9 100644 --- a/string/ahoCorasick.cpp +++ b/string/ahoCorasick.cpp @@ -4,7 +4,7 @@ struct AhoCorasick { struct vert { int suffix, exit, character, parent; vector<int> nxt, patterns; - vert(int c, int p) : suffix(-1), exit(-1), + vert(int c, int p) : suffix(-1), exit(-1), character(c), nxt(ALPHABET_SIZE, -1), parent(p) {} }; vector<vert> aho; @@ -28,7 +28,7 @@ struct AhoCorasick { int getSuffix(int v) { if (aho[v].suffix == -1) { if (v == 0 || aho[v].parent == 0) aho[v].suffix = 0; - else aho[v].suffix = go(getSuffix(aho[v].parent), + else aho[v].suffix = go(getSuffix(aho[v].parent), aho[v].character); } return aho[v].suffix; |
