summaryrefslogtreecommitdiff
path: root/test/string
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2025-11-20 17:49:40 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2025-11-20 17:49:40 +0100
commitfcb02c67748678e317cac58f7e43c3ed83860ad9 (patch)
treeb4c3f49874a6352d2bcc31f001c7802b18418b1d /test/string
parent4c4aea6abd680b62132ead1c9cc943e3e489271d (diff)
fix minor errors in tests
Diffstat (limited to 'test/string')
-rw-r--r--test/string/suffixTree.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/string/suffixTree.cpp b/test/string/suffixTree.cpp
index 6f3d912..fd2f5ea 100644
--- a/test/string/suffixTree.cpp
+++ b/test/string/suffixTree.cpp
@@ -19,7 +19,7 @@ void stress_test() {
auto dfs = [&](auto&& self, string pref, ll node) -> void {
auto& [l, r, _, next] = st.tree[node];
if (l >= 0) pref += s.substr(l, r - l);
- if (pref.back() == '#') got[n + 1 - ssize(pref)] = pref;
+ if (!pref.empty() && pref.back() == '#') got[n + 1 - ssize(pref)] = pref;
for (auto [__, j] : next) {
self(self, pref, j);
}