diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-10 23:47:01 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-10-15 11:58:34 +0100 |
commit | afc70df7ea3e5d0ef5e0b9ecd7beefefeb954645 (patch) | |
tree | 19681cc62b0ebcddf3674877beacb6dddeafd0a3 /src | |
parent | ringct: avoid unnecessary memcpy (diff) | |
download | monero-afc70df7ea3e5d0ef5e0b9ecd7beefefeb954645.tar.xz |
ringct: reserve space in vectors to avoid excessive reallocation
Diffstat (limited to 'src')
-rw-r--r-- | src/ringct/rctSigs.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index 80ece9c44..fd2912684 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -351,6 +351,7 @@ namespace rct { key get_pre_mlsag_hash(const rctSig &rv) { keyV hashes; + hashes.reserve(3); hashes.push_back(rv.message); crypto::hash h; @@ -364,6 +365,7 @@ namespace rct { hashes.push_back(hash2rct(h)); keyV kv; + kv.reserve((64*3+1) * rv.p.rangeSigs.size()); for (auto r: rv.p.rangeSigs) { for (size_t n = 0; n < 64; ++n) |