summaryrefslogtreecommitdiff
path: root/string/ahoCorasick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'string/ahoCorasick.cpp')
-rw-r--r--string/ahoCorasick.cpp4
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;