mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-23 21:57:46 +00:00
bulletproofs: reserve vector memory when known in advance
This commit is contained in:
parent
7e2483e1d5
commit
6a1062f560
1 changed files with 2 additions and 0 deletions
|
@ -112,6 +112,7 @@ static void init_exponents()
|
||||||
if (init_done)
|
if (init_done)
|
||||||
return;
|
return;
|
||||||
std::vector<MultiexpData> data;
|
std::vector<MultiexpData> data;
|
||||||
|
data.reserve(maxN*maxM*2);
|
||||||
for (size_t i = 0; i < maxN*maxM; ++i)
|
for (size_t i = 0; i < maxN*maxM; ++i)
|
||||||
{
|
{
|
||||||
Hi[i] = get_exponent(rct::H, i * 2);
|
Hi[i] = get_exponent(rct::H, i * 2);
|
||||||
|
@ -1056,6 +1057,7 @@ bool bulletproof_VERIFY(const std::vector<const Bulletproof*> &proofs)
|
||||||
bool bulletproof_VERIFY(const std::vector<Bulletproof> &proofs)
|
bool bulletproof_VERIFY(const std::vector<Bulletproof> &proofs)
|
||||||
{
|
{
|
||||||
std::vector<const Bulletproof*> proof_pointers;
|
std::vector<const Bulletproof*> proof_pointers;
|
||||||
|
proof_pointers.reserve(proofs.size());
|
||||||
for (const Bulletproof &proof: proofs)
|
for (const Bulletproof &proof: proofs)
|
||||||
proof_pointers.push_back(&proof);
|
proof_pointers.push_back(&proof);
|
||||||
return bulletproof_VERIFY(proof_pointers);
|
return bulletproof_VERIFY(proof_pointers);
|
||||||
|
|
Loading…
Reference in a new issue