From 61cac9c0febbb5440b99e22770d917bf3a63c405 Mon Sep 17 00:00:00 2001 From: MZuenni Date: Wed, 11 Jan 2023 11:15:50 +0100 Subject: dont use .size() --- string/suffixTree.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'string/suffixTree.cpp') diff --git a/string/suffixTree.cpp b/string/suffixTree.cpp index 7af3ee6..2601c34 100644 --- a/string/suffixTree.cpp +++ b/string/suffixTree.cpp @@ -53,7 +53,6 @@ struct SuffixTree { if (!tree[curVert].next.count(s[curEdge])) { int leaf = newVert(pos, sz(s)); tree[curVert].next[s[curEdge]] = leaf; - tree[curVert].next[s[curEdge]] = leaf; addSuffixLink(curVert); } else { int nxt = tree[curVert].next[s[curEdge]]; @@ -77,7 +76,7 @@ struct SuffixTree { curLen--; curEdge = pos - remainder + 1; } else { - curVert = tree[curVert].suffix ? tree[curVert].suffix + curVert = tree[curVert].suffix ? tree[curVert].suffix : root; }}} }; \ No newline at end of file -- cgit v1.2.3