1
0
Fork 0
forked from lthn/blockchain

fix loop variable type here and there (performance)

This commit is contained in:
sowle 2024-02-16 03:56:42 +01:00
parent 075a28f89f
commit b21083db1f
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
3 changed files with 6 additions and 6 deletions

View file

@ -5818,7 +5818,7 @@ bool blockchain_storage::validate_tx_for_hardfork_specific_terms(const transacti
};
//inputs
for (const auto in : tx.vin)
for (const auto& in : tx.vin)
{
if (!var_is_after_hardfork_1_zone && !is_allowed_before_hardfork1(in))
return false;
@ -5832,7 +5832,7 @@ bool blockchain_storage::validate_tx_for_hardfork_specific_terms(const transacti
return false;
}
//outputs
for (const auto out : tx.vout)
for (const auto& out : tx.vout)
{
if (!var_is_after_hardfork_1_zone && !is_allowed_before_hardfork1(out))
return false;
@ -5848,7 +5848,7 @@ bool blockchain_storage::validate_tx_for_hardfork_specific_terms(const transacti
size_t count_ado = 0;
//extra
for (const auto el : tx.extra)
for (const auto& el : tx.extra)
{
if (el.type() == typeid(asset_descriptor_operation))
count_ado++;
@ -5863,7 +5863,7 @@ bool blockchain_storage::validate_tx_for_hardfork_specific_terms(const transacti
}
//attachments
for (const auto el : tx.attachment)
for (const auto& el : tx.attachment)
{
if (!var_is_after_hardfork_2_zone && !is_allowed_before_hardfork2(el))
return false;

View file

@ -2506,7 +2506,7 @@ namespace currency
tx.attachment.insert(tx.attachment.end(), attachments_local.begin(), attachments_local.end());
tx.extra.insert(tx.extra.end(), extra_local.begin(), extra_local.end());
for (const auto in : tx.vin)
for (const auto& in : tx.vin)
{
if (in.type() == typeid(txin_zc_input))
{

View file

@ -679,7 +679,7 @@ namespace currency
{
std::list<currency::extra_alias_entry> al_list;
m_core.get_tx_pool().get_aliases_from_tx_pool(al_list);
for (const auto a : al_list)
for (const auto& a : al_list)
{
res.aliases_que.push_back(alias_info_to_rpc_alias_info(a));
}