refactor: extract STATIC_SIZE constant to prevector

Co-authored-by: Anthony Towns <aj@erisian.com.au>
This commit is contained in:
Lőrinc
2025-04-22 13:00:34 +02:00
parent 3b188b8b3d
commit 756da2a994
3 changed files with 27 additions and 22 deletions

View File

@@ -8,6 +8,7 @@
#include <key.h>
#include <prevector.h>
#include <random.h>
#include <script/script.h>
#include <cstddef>
#include <cstdint>
@@ -16,7 +17,6 @@
static const size_t BATCHES = 101;
static const size_t BATCH_SIZE = 30;
static const int PREVECTOR_SIZE = 28;
static const unsigned int QUEUE_BATCH_SIZE = 128;
// This Benchmark tests the CheckQueue with a slightly realistic workload,
@@ -30,9 +30,9 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
ECC_Context ecc_context{};
struct PrevectorJob {
prevector<PREVECTOR_SIZE, uint8_t> p;
prevector<CScriptBase::STATIC_SIZE, uint8_t> p;
explicit PrevectorJob(FastRandomContext& insecure_rand){
p.resize(insecure_rand.randrange(PREVECTOR_SIZE*2));
p.resize(insecure_rand.randrange(CScriptBase::STATIC_SIZE * 2));
}
std::optional<int> operator()()
{