From ed2c81ed95be71bace897e62a0c241068cfde7be Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 16 Apr 2018 00:16:02 +0100 Subject: replace std::list with std::vector on some hot paths also use reserve where appropriate --- src/blockchain_utilities/blockchain_import.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/blockchain_utilities/blockchain_import.cpp') diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index caa549c13..3078ec31b 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -164,7 +164,7 @@ int pop_blocks(cryptonote::core& core, int num_blocks) return num_blocks; } -int check_flush(cryptonote::core &core, std::list &blocks, bool force) +int check_flush(cryptonote::core &core, std::vector &blocks, bool force) { if (blocks.empty()) return 0; @@ -176,7 +176,7 @@ int check_flush(cryptonote::core &core, std::list &blocks, if (!force && new_height % HASH_OF_HASHES_STEP) return 0; - std::list hashes; + std::vector hashes; for (const auto &b: blocks) { cryptonote::block block; @@ -312,7 +312,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path MINFO("Reading blockchain from bootstrap file..."); std::cout << ENDL; - std::list blocks; + std::vector blocks; // Skip to start_height before we start adding. { @@ -437,7 +437,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path { cryptonote::blobdata block; cryptonote::block_to_blob(bp.block, block); - std::list txs; + std::vector txs; for (const auto &tx: bp.txs) { txs.push_back(cryptonote::blobdata()); -- cgit v1.2.3