Merge bitcoin/bitcoin#22464: bench: fix 32-bit narrowing warning in bench/peer_eviction.cpp

e49d50cf40 bench: fix 32-bit narrowing warning in bench/peer_eviction.cpp (Jon Atack)

Pull request description:

  Closes https://github.com/bitcoin/bitcoin/issues/22459.

ACKs for top commit:
  hebasto:
    ACK e49d50cf40, tested on Debian 10.10 (i386):

Tree-SHA512: 8ca366fc296c633dbc8b8e0e7d80f4f6a64d02fb3da86d199881364f027d34b816a3c964b3fea2c1cc0b3ad51dd02d93c8bb14b5ebbd99fb4073cd1031766332
This commit is contained in:
MarcoFalke 2021-07-16 08:04:41 +02:00
commit f8b20fd35b
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -27,7 +27,8 @@ static void EvictionProtectionCommon(
candidate_setup_fn(c);
}
std::vector<Candidates> copies{bench.epochs() * bench.epochIterations(), candidates};
std::vector<Candidates> copies{
static_cast<size_t>(bench.epochs() * bench.epochIterations()), candidates};
size_t i{0};
bench.run([&] {
ProtectEvictionCandidatesByRatio(copies.at(i));