summaryrefslogtreecommitdiff
path: root/string/suffixTree.cpp
diff options
context:
space:
mode:
authorMZuenni <michi.zuendorf@gmail.com>2023-01-11 11:15:50 +0100
committerMZuenni <michi.zuendorf@gmail.com>2023-01-11 11:15:50 +0100
commit61cac9c0febbb5440b99e22770d917bf3a63c405 (patch)
tree98b7dc3b77ada4cffe5b81daded5516b941f28ec /string/suffixTree.cpp
parentfd1f2b36e95c03625297b7b8cba3b1a04a0cc0ed (diff)
dont use .size()
Diffstat (limited to 'string/suffixTree.cpp')
-rw-r--r--string/suffixTree.cpp3
1 files changed, 1 insertions, 2 deletions
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