aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2018-11-16 11:16:12 +0200
committerRiccardo Spagni <ric@spagni.net>2018-11-16 11:16:12 +0200
commit0295055bcb6f7d346ba8eba469cc7c73e8659283 (patch)
treeefb98b4e2bad35ebce9ca7bafa3726a1a082a0d9
parentMerge pull request #4804 (diff)
parentbulletproofs: reserve vector memory when known in advance (diff)
downloadmonero-0295055bcb6f7d346ba8eba469cc7c73e8659283.tar.xz
Merge pull request #4805
6a1062f5 bulletproofs: reserve vector memory when known in advance (moneromooo-monero)
-rw-r--r--src/ringct/bulletproofs.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ringct/bulletproofs.cc b/src/ringct/bulletproofs.cc
index bed48769a..1592e74e4 100644
--- a/src/ringct/bulletproofs.cc
+++ b/src/ringct/bulletproofs.cc
@@ -112,6 +112,7 @@ static void init_exponents()
if (init_done)
return;
std::vector<MultiexpData> data;
+ data.reserve(maxN*maxM*2);
for (size_t i = 0; i < maxN*maxM; ++i)
{
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)
{
std::vector<const Bulletproof*> proof_pointers;
+ proof_pointers.reserve(proofs.size());
for (const Bulletproof &proof: proofs)
proof_pointers.push_back(&proof);
return bulletproof_VERIFY(proof_pointers);