summaryrefslogtreecommitdiff
path: root/test/string/duval.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:17:29 +0100
commit1880ccb6d85c6eb79e724593457877bab431951c (patch)
tree23eddd5bd0b29b3024e170a5ef9023eda9226ab5 /test/string/duval.cpp
parente95f59debd69ee7d45d5c966ce466d23264e1c3c (diff)
get rid of all() and sz()
Diffstat (limited to 'test/string/duval.cpp')
-rw-r--r--test/string/duval.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/string/duval.cpp b/test/string/duval.cpp
index 58b4a44..5ebc96c 100644
--- a/test/string/duval.cpp
+++ b/test/string/duval.cpp
@@ -6,8 +6,8 @@ constexpr int N = 20'000'000;
bool isLyndon(string_view s) {
string t = string(s) + string(s);
- for (ll i = 1; i < sz(s); i++) {
- if (s >= t.substr(i, sz(s))) return false;
+ for (ll i = 1; i < ssize(s); i++) {
+ if (s >= t.substr(i, ssize(s))) return false;
}
return !s.empty();
}
@@ -21,11 +21,11 @@ void stress_test_duval() {
if (got.empty()) cerr << "error: a" << FAIL;
if (got.front().first != 0) cerr << "error: b" << FAIL;
if (got.back().second != n) cerr << "error: c" << FAIL;
- for (int j = 1; j < sz(got); j++) {
- if (got[j - 1].second != got[j].first) cerr << "error: d" << FAIL;
+ for (int j = 1; j < ssize(got); j++) {
+ if (got[j - 1].second != got[j].first) cerr << "error: d" << FAIL;
}
for (auto [l, r] : got) {
- if (!isLyndon(string_view(s).substr(l, r-l))) cerr << "error: e" << FAIL;
+ if (!isLyndon(string_view(s).substr(l, r-l))) cerr << "error: e" << FAIL;
}
queries += n;
}
@@ -45,7 +45,7 @@ void performance_test_duval() {
}
int naive(string s) {
- ll n = sz(s);
+ ll n = ssize(s);
s += s;
int res = 0;
for (int i = 0; i < n; i++) {