aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdutils/test
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-02-28 10:03:53 +0300
committerlevlam <levlam@telegram.org>2025-02-28 10:03:53 +0300
commit8034c2cf4e733b803b062a8b330683e1b3b06137 (patch)
treec4386d251ec2ccbc709d751ca9f9f2e432b21bd9 /tdutils/test
parent9cd7c27acc4ee1a4939b112672bc1806d21ee2bd (diff)
Use using in HashSet benchmark.
Diffstat (limited to 'tdutils/test')
-rw-r--r--tdutils/test/hashset_benchmark.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/tdutils/test/hashset_benchmark.cpp b/tdutils/test/hashset_benchmark.cpp
index 81c729ffe..34250cf06 100644
--- a/tdutils/test/hashset_benchmark.cpp
+++ b/tdutils/test/hashset_benchmark.cpp
@@ -290,7 +290,6 @@ static void BM_emplace_string(benchmark::State &state) {
}
}
-namespace td {
template <class K, class V, class FunctT>
static void table_remove_if(absl::flat_hash_map<K, V> &table, FunctT &&func) {
for (auto it = table.begin(); it != table.end();) {
@@ -303,7 +302,6 @@ static void table_remove_if(absl::flat_hash_map<K, V> &table, FunctT &&func) {
}
}
}
-} // namespace td
template <typename TableT>
static void BM_remove_if(benchmark::State &state) {
@@ -320,7 +318,8 @@ static void BM_remove_if(benchmark::State &state) {
}
state.ResumeTiming();
- td::table_remove_if(table, [](auto &it) { return it.second % 2 == 0; });
+ using td::table_remove_if;
+ table_remove_if(table, [](auto &it) { return it.second % 2 == 0; });
}
}
@@ -421,7 +420,8 @@ static void BM_remove_if_slow(benchmark::State &state) {
auto first_key = table.begin()->first;
{
std::size_t cnt = 0;
- td::table_remove_if(table, [&cnt, n = N](auto &) {
+ using td::table_remove_if;
+ table_remove_if(table, [&cnt, n = N](auto &) {
cnt += 2;
return cnt <= n;
});
@@ -446,7 +446,8 @@ static void BM_remove_if_slow_old(benchmark::State &state) {
table.emplace(rnd() + 1, i);
if (table.size() > N) {
std::size_t cnt = 0;
- td::table_remove_if(table, [&cnt, n = N](auto &) {
+ using td::table_remove_if;
+ table_remove_if(table, [&cnt, n = N](auto &) {
cnt += 2;
return cnt <= n;
});