diff options
| author | levlam <levlam@telegram.org> | 2022-11-23 19:37:32 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-11-23 19:37:32 +0300 |
| commit | af05db3f15fd36932b64e270a7663a8ba34d065e (patch) | |
| tree | 673cb43a0e58dafc85260b096954a4a56f837aa0 /benchmark/hashmap_build.cpp | |
| parent | b1ddf9d3a7c739b9cdfdfe55fa34c6d2ccbadab5 (diff) | |
Add td::Hash and use it everywhere instead of unusable std::hash.
Diffstat (limited to 'benchmark/hashmap_build.cpp')
| -rw-r--r-- | benchmark/hashmap_build.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/benchmark/hashmap_build.cpp b/benchmark/hashmap_build.cpp index 7d63acb71..f6e71b748 100644 --- a/benchmark/hashmap_build.cpp +++ b/benchmark/hashmap_build.cpp @@ -25,19 +25,19 @@ //#define CREATE_MAP(num) CREATE_MAP_IMPL(num) #define CREATE_MAP(num) -#define CREATE_MAP_IMPL(num) \ - int f_##num() { \ - test_map<int, std::array<char, num>> m; \ - m.emplace(1, std::array<char, num>{}); \ - int sum = 0; \ - for (auto &it : m) { \ - sum += it.first; \ - } \ - auto it = m.find(1); \ - sum += it->first; \ - m.erase(it); \ - return sum; \ - } \ +#define CREATE_MAP_IMPL(num) \ + int f_##num() { \ + test_map<td::int32, std::array<char, num>> m; \ + m.emplace(1, std::array<char, num>{}); \ + int sum = 0; \ + for (auto &it : m) { \ + sum += it.first; \ + } \ + auto it = m.find(1); \ + sum += it->first; \ + m.erase(it); \ + return sum; \ + } \ int x_##num = f_##num() CREATE_MAP(__LINE__); |
