diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-05 14:31:49 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-11-05 14:32:32 +0000 |
commit | 6a1062f56001968dd593757403091cdbec36f2cb (patch) | |
tree | 406681b60e28349ff7e83e5c125ac858d3cb097f /src/ringct | |
parent | Merge pull request #4702 (diff) | |
download | monero-6a1062f56001968dd593757403091cdbec36f2cb.tar.xz |
bulletproofs: reserve vector memory when known in advance
Diffstat (limited to 'src/ringct')
-rw-r--r-- | src/ringct/bulletproofs.cc | 2 |
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); |