/
githubmirror
/
bitcoin
Обзор
Документация
Войти
/
githubmirror
/
bitcoin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/bench/strencodings.cpp
25 строк
711 B
Hennadii Stepanov
iwyu: Fix warnings in `src/bench` and treat them as error
10 июн 2026, 12:32
Не верифицирован
10 июн 2026, 12:32
6751a32
Код
Авторство
О чём код?
// Copyright (c) 2022-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <bench/bench.h> #include <consensus/consensus.h> #include <crypto/hex_base.h> #include <random.h> #include <cstddef> #include <span> #include <string> #include <vector> static void HexStrBench(benchmark::Bench& bench) { FastRandomContext rng{/*fDeterministic=*/true}; auto data{rng.randbytes<std::byte>(MAX_BLOCK_WEIGHT)}; bench.batch(data.size()).unit("byte").run([&] { auto hex = HexStr(data); ankerl::nanobench::doNotOptimizeAway(hex); }); } BENCHMARK(HexStrBench);