feat: add trim in string op opposited with strip

This commit is contained in:
yyc12345 committed 2025-10-01 20:53:43 +08:00
1 parent 05a80268ab
commit 446f880df4
5 files changed
+153 -7

No files matched your search

+8
View File
@@ -15,4 +15,12 @@ namespace yyccbench::string::op {
}
BENCHMARK(BM_StringStrip)->Name("StringStrip");
static void BM_StringTrim(benchmark::State& state) {
std::u8string_view strl = u8" \thello\r\n"sv, words = u8" \t\r\n"sv;
for (auto _ : state) {
auto rv = OP::trim(strl, words);
}
}
BENCHMARK(BM_StringTrim)->Name("StringTrim");
}