Merge pull request #6661

267ce5b71 avoid a couple needless copies (moneromooo-monero)
pull/320/head
Alexander Blair 4 years ago
commit bc48494731
No known key found for this signature in database
GPG Key ID: C64552D877C32479

@ -1301,7 +1301,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
size_t count = 0;
size_t max_i = timestamps.size()-1;
// get difficulties and timestamps from most recent blocks in alt chain
for (const auto bei: boost::adaptors::reverse(alt_chain))
for (const auto &bei: boost::adaptors::reverse(alt_chain))
{
timestamps[max_i - count] = bei.bl.timestamp;
cumulative_difficulties[max_i - count] = bei.cumulative_difficulty;

@ -1548,7 +1548,7 @@ namespace hw {
const bool need_additional_txkeys_x = need_additional_txkeys;
std::vector<crypto::secret_key> additional_tx_keys_x;
for (const auto k: additional_tx_keys) {
for (const auto &k: additional_tx_keys) {
additional_tx_keys_x.push_back(hw::ledger::decrypt(k));
}

Loading…
Cancel
Save