mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-30 03:03:17 +00:00
ringct: reserve space in vectors to avoid excessive reallocation
This commit is contained in:
parent
9ebf7b6dcf
commit
afc70df7ea
1 changed files with 2 additions and 0 deletions
|
@ -351,6 +351,7 @@ namespace rct {
|
||||||
key get_pre_mlsag_hash(const rctSig &rv)
|
key get_pre_mlsag_hash(const rctSig &rv)
|
||||||
{
|
{
|
||||||
keyV hashes;
|
keyV hashes;
|
||||||
|
hashes.reserve(3);
|
||||||
hashes.push_back(rv.message);
|
hashes.push_back(rv.message);
|
||||||
crypto::hash h;
|
crypto::hash h;
|
||||||
|
|
||||||
|
@ -364,6 +365,7 @@ namespace rct {
|
||||||
hashes.push_back(hash2rct(h));
|
hashes.push_back(hash2rct(h));
|
||||||
|
|
||||||
keyV kv;
|
keyV kv;
|
||||||
|
kv.reserve((64*3+1) * rv.p.rangeSigs.size());
|
||||||
for (auto r: rv.p.rangeSigs)
|
for (auto r: rv.p.rangeSigs)
|
||||||
{
|
{
|
||||||
for (size_t n = 0; n < 64; ++n)
|
for (size_t n = 0; n < 64; ++n)
|
||||||
|
|
Loading…
Reference in a new issue