replace std::list with std::vector on some hot paths
also use reserve where appropriate
This commit is contained in:
@@ -64,7 +64,7 @@ bool gen_double_spend_base<concrete_test>::check_block_verification_context(cons
|
||||
template<class concrete_test>
|
||||
bool gen_double_spend_base<concrete_test>::mark_last_valid_block(cryptonote::core& c, size_t /*ev_index*/, const std::vector<test_event_entry>& /*events*/)
|
||||
{
|
||||
std::list<cryptonote::block> block_list;
|
||||
std::vector<cryptonote::block> block_list;
|
||||
bool r = c.get_blocks(c.get_current_blockchain_height() - 1, 1, block_list);
|
||||
CHECK_AND_ASSERT_MES(r, false, "core::get_blocks failed");
|
||||
m_last_valid_block = block_list.back();
|
||||
@@ -96,7 +96,7 @@ bool gen_double_spend_base<concrete_test>::check_double_spend(cryptonote::core&
|
||||
}
|
||||
CHECK_NOT_EQ(invalid_index_value, m_invalid_block_index);
|
||||
|
||||
std::list<cryptonote::block> block_list;
|
||||
std::vector<cryptonote::block> block_list;
|
||||
bool r = c.get_blocks(0, 100 + 2 * CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, block_list);
|
||||
CHECK_TEST_CONDITION(r);
|
||||
CHECK_TEST_CONDITION(m_last_valid_block == block_list.back());
|
||||
|
||||
Reference in New Issue
Block a user