diff options
author | luigi1111 <luigi1111w@gmail.com> | 2021-02-18 14:06:47 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2021-02-18 14:06:47 -0500 |
commit | 6556c33f133782b682938f14360cc6aeb39901c3 (patch) | |
tree | 8ee3c410f75a25d63adc96e94c46e81174f6cb2f /tests | |
parent | Merge pull request #7352 (diff) | |
parent | Remove copies from foreach loops (thanks to Clang) (diff) | |
download | monero-6556c33f133782b682938f14360cc6aeb39901c3.tar.xz |
Merge pull request #7355
bd12984 Remove copies from foreach loops (thanks to Clang) (Lee Clagett)
1572df9 Removing unused namespace alias (Lee Clagett)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core_tests/tx_pool.cpp | 4 | ||||
-rw-r--r-- | tests/unit_tests/net.cpp | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/core_tests/tx_pool.cpp b/tests/core_tests/tx_pool.cpp index 26c0d7304..166eb6075 100644 --- a/tests/core_tests/tx_pool.cpp +++ b/tests/core_tests/tx_pool.cpp @@ -390,7 +390,7 @@ bool txpool_double_spend_base::check_changed(cryptonote::core& c, const size_t e } } - for (const std::pair<crypto::hash, uint64_t>& hash : m_all_hashes) + for (const std::pair<const crypto::hash, uint64_t>& hash : m_all_hashes) { cryptonote::blobdata tx_blob{}; if (!c.get_pool_transaction(hash.first, tx_blob, cryptonote::relay_category::all)) @@ -408,7 +408,7 @@ bool txpool_double_spend_base::check_changed(cryptonote::core& c, const size_t e for (const crypto::hash& hash : m_no_relay_hashes) difference.erase(hash); - for (const std::pair<crypto::hash, uint64_t>& hash : difference) + for (const std::pair<const crypto::hash, uint64_t>& hash : difference) { if (c.pool_has_tx(hash.first)) { diff --git a/tests/unit_tests/net.cpp b/tests/unit_tests/net.cpp index dffda5e4e..2836fd948 100644 --- a/tests/unit_tests/net.cpp +++ b/tests/unit_tests/net.cpp @@ -1351,7 +1351,7 @@ TEST(dandelionpp_map, dropped_connection) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(3u, entry.second); for (const boost::uuids::uuid& connection : in_connections) @@ -1409,7 +1409,7 @@ TEST(dandelionpp_map, dropped_connection) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(3u, entry.second); } { @@ -1472,7 +1472,7 @@ TEST(dandelionpp_map, dropped_connection_remapped) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(3u, entry.second); for (const boost::uuids::uuid& connection : in_connections) @@ -1511,7 +1511,7 @@ TEST(dandelionpp_map, dropped_connection_remapped) } EXPECT_EQ(2u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(5u, entry.second); } // select 3 of 3 connections but do not remap existing links @@ -1532,7 +1532,7 @@ TEST(dandelionpp_map, dropped_connection_remapped) } EXPECT_EQ(2u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(5u, entry.second); } // map 8 new incoming connections across 3 outgoing links @@ -1555,7 +1555,7 @@ TEST(dandelionpp_map, dropped_connection_remapped) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(6u, entry.second); } } @@ -1609,7 +1609,7 @@ TEST(dandelionpp_map, dropped_all_connections) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(3u, entry.second); for (const boost::uuids::uuid& connection : in_connections) @@ -1641,7 +1641,7 @@ TEST(dandelionpp_map, dropped_all_connections) } EXPECT_EQ(3u, used.size()); - for (const std::pair<boost::uuids::uuid, std::size_t>& entry : used) + for (const std::pair<const boost::uuids::uuid, std::size_t>& entry : used) EXPECT_EQ(3u, entry.second); } } |