diff --git a/benchmark/hashmap_build.cpp b/benchmark/hashmap_build.cpp index be58967de..479761728 100644 --- a/benchmark/hashmap_build.cpp +++ b/benchmark/hashmap_build.cpp @@ -7,6 +7,7 @@ #include "td/utils/FlatHashMap.h" #include +#include #include #include #include diff --git a/tdutils/td/utils/FlatHashMap.h b/tdutils/td/utils/FlatHashMap.h index 85eb2f95f..e30df0b32 100644 --- a/tdutils/td/utils/FlatHashMap.h +++ b/tdutils/td/utils/FlatHashMap.h @@ -14,7 +14,6 @@ #include #include #include -#include #include namespace td { @@ -585,10 +584,8 @@ using FlatHashSetImpl = FlatHashTable, HashT, EqT>; template , class EqT = std::equal_to> using FlatHashMap = FlatHashMapImpl; -//using FlatHashMap = std::unordered_map; template , class EqT = std::equal_to> using FlatHashSet = FlatHashSetImpl; -//using FlatHashSet = std::unordered_set; } // namespace td diff --git a/tdutils/test/HashSet.cpp b/tdutils/test/HashSet.cpp index 773944ac5..f6c19caac 100644 --- a/tdutils/test/HashSet.cpp +++ b/tdutils/test/HashSet.cpp @@ -25,15 +25,15 @@ static auto extract_kv(const T &reference) { TEST(FlatHashMap, basic) { { - td::FlatHashSet s; - s.insert(5); - for (auto x : s) { - } - int N = 100000; - for (int i = 0; i < 10000000; i++) { - s.insert((i + N/2)%N); - s.erase(i%N); - } + td::FlatHashSet s; + s.insert(5); + for (auto x : s) { + } + int N = 100000; + for (int i = 0; i < 10000000; i++) { + s.insert((i + N / 2) % N); + s.erase(i % N); + } } { td::FlatHashMap map; diff --git a/tdutils/test/hashset_benchmark.cpp b/tdutils/test/hashset_benchmark.cpp index 714726eb4..6fe486bd7 100644 --- a/tdutils/test/hashset_benchmark.cpp +++ b/tdutils/test/hashset_benchmark.cpp @@ -248,7 +248,7 @@ static void BM_emplace_same(benchmark::State &state) { while (state.KeepRunningBatch(BATCH_SIZE)) { for (size_t i = 0; i < BATCH_SIZE; i++) { - benchmark::DoNotOptimize(table.emplace(key + (i & 15) * 100 , 43784932)); + benchmark::DoNotOptimize(table.emplace(key + (i & 15) * 100, 43784932)); } } } @@ -383,7 +383,10 @@ static void BM_remove_if_slow(benchmark::State &state) { auto first_key = table.begin()->first; { size_t cnt = 0; - td::table_remove_if(table, [&cnt](auto &) { cnt += 2; return cnt <= N; }); + td::table_remove_if(table, [&cnt](auto &) { + cnt += 2; + return cnt <= N; + }); } while (state.KeepRunningBatch(BATCH_SIZE)) { for (size_t i = 0; i < BATCH_SIZE; i++) {