From 12afe719ce268bb10aa93a910079a44eb08999b8 Mon Sep 17 00:00:00 2001 From: MZuenni Date: Wed, 1 Mar 2023 11:36:26 +0100 Subject: removed trailing whitespaces and use more structured bindings --- string/ahoCorasick.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string/ahoCorasick.cpp') 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 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 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; -- cgit v1.2.3