From d4455e4ca20f2adb022712411a6edec861ecd1fb Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Thu, 10 Oct 2024 20:14:25 +0100 Subject: [PATCH] Using type inference in a few places for iterators. --- nano/nano_node/entry.cpp | 4 ++-- nano/secure/ledger.cpp | 6 +++--- nano/test_common/system.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nano/nano_node/entry.cpp b/nano/nano_node/entry.cpp index ae49f157a8..66b9a86fa6 100644 --- a/nano/nano_node/entry.cpp +++ b/nano/nano_node/entry.cpp @@ -1942,7 +1942,7 @@ int main (int argc, char * const * argv) nano::locked>> opened_account_versions_shared (epoch_count); using opened_account_versions_t = decltype (opened_account_versions_shared)::value_type; node->store.account.for_each_par ( - [&opened_account_versions_shared, epoch_count] (nano::store::read_transaction const & /*unused*/, nano::store::iterator i, nano::store::iterator n) { + [&opened_account_versions_shared, epoch_count] (nano::store::read_transaction const & /*unused*/, auto i, auto n) { // First cache locally opened_account_versions_t opened_account_versions_l (epoch_count); for (; i != n; ++i) @@ -1979,7 +1979,7 @@ int main (int argc, char * const * argv) nano::locked>> unopened_highest_pending_shared; using unopened_highest_pending_t = decltype (unopened_highest_pending_shared)::value_type; node->store.pending.for_each_par ( - [&unopened_highest_pending_shared, &opened_accounts] (nano::store::read_transaction const & /*unused*/, nano::store::iterator i, nano::store::iterator n) { + [&unopened_highest_pending_shared, &opened_accounts] (nano::store::read_transaction const & /*unused*/, auto i, auto n) { // First cache locally unopened_highest_pending_t unopened_highest_pending_l; for (; i != n; ++i) diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index bc9514a8b1..93eb61ceac 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -749,7 +749,7 @@ void nano::ledger::initialize (nano::generate_cache_flags const & generate_cache if (generate_cache_flags_a.reps || generate_cache_flags_a.account_count || generate_cache_flags_a.block_count) { store.account.for_each_par ( - [this] (store::read_transaction const & /*unused*/, store::iterator i, store::iterator n) { + [this] (store::read_transaction const & /*unused*/, auto i, auto n) { uint64_t block_count_l{ 0 }; uint64_t account_count_l{ 0 }; for (; i != n; ++i) @@ -763,7 +763,7 @@ void nano::ledger::initialize (nano::generate_cache_flags const & generate_cache }); store.rep_weight.for_each_par ( - [this] (store::read_transaction const & /*unused*/, store::iterator i, store::iterator n) { + [this] (store::read_transaction const & /*unused*/, auto i, auto n) { nano::rep_weights rep_weights_l{ this->store.rep_weight }; for (; i != n; ++i) { @@ -776,7 +776,7 @@ void nano::ledger::initialize (nano::generate_cache_flags const & generate_cache if (generate_cache_flags_a.cemented_count) { store.confirmation_height.for_each_par ( - [this] (store::read_transaction const & /*unused*/, store::iterator i, store::iterator n) { + [this] (store::read_transaction const & /*unused*/, auto i, auto n) { uint64_t cemented_count_l (0); for (; i != n; ++i) { diff --git a/nano/test_common/system.cpp b/nano/test_common/system.cpp index c0a9831cf0..40f8be2203 100644 --- a/nano/test_common/system.cpp +++ b/nano/test_common/system.cpp @@ -532,7 +532,7 @@ void nano::test::system::generate_send_existing (nano::node & node_a, std::vecto nano::account account; random_pool::generate_block (account.bytes.data (), sizeof (account.bytes)); auto transaction = node_a.ledger.tx_begin_read (); - store::iterator entry (node_a.store.account.begin (transaction, account)); + auto entry = node_a.store.account.begin (transaction, account); if (entry == node_a.store.account.end ()) { entry = node_a.store.account.begin (transaction);