diff --git a/src/bls/src/bls_c_impl.hpp b/src/bls/src/bls_c_impl.hpp index ae30960489b6d..bb1fba857abf0 100644 --- a/src/bls/src/bls_c_impl.hpp +++ b/src/bls/src/bls_c_impl.hpp @@ -452,6 +452,8 @@ int blsAggregateVerifyNoCheck(const blsSignature *sig, const blsPublicKey *pubVe std::vector> futuresMiller; std::vector> futures; size_t numThreads = std::thread::hardware_concurrency(); + + futures.reserve(numThreads); while (n > 0) { size_t m = mcl::fp::min_(n, N); diff --git a/src/blsct/range_proof/bulletproofs/range_proof_logic.cpp b/src/blsct/range_proof/bulletproofs/range_proof_logic.cpp index 0524f9fdab11c..c0d8a3ea3c24b 100644 --- a/src/blsct/range_proof/bulletproofs/range_proof_logic.cpp +++ b/src/blsct/range_proof/bulletproofs/range_proof_logic.cpp @@ -253,6 +253,8 @@ bool RangeProofLogic::VerifyProofs( // Vector to hold future results from async tasks std::vector> futures; + futures.reserve(proof_transcripts.size()); + // Launch a verification task for each proof transcript in parallel for (const RangeProofWithTranscript& p : proof_transcripts) { futures.emplace_back(std::async(std::launch::async, [this, &p, max_mn]() -> bool {