diff options
author | glozow <gloriajzhao@gmail.com> | 2024-05-02 11:24:36 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2024-05-02 11:24:36 +0100 |
commit | 7f6fb73c82fdff2afe5edefcc335ba6707d5627d (patch) | |
tree | 3efdd1f5c1101a7b46e378faddd88ee5ab27bd14 | |
parent | 6119f76ef72c1adc55c1a384c20f8ba9e1a01206 (diff) | |
download | bitcoin-7f6fb73c82fdff2afe5edefcc335ba6707d5627d.tar.xz |
[refactor] use reference in for loop through iters
-rw-r--r-- | src/txorphanage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/txorphanage.cpp b/src/txorphanage.cpp index 82206e56c3..92055ded72 100644 --- a/src/txorphanage.cpp +++ b/src/txorphanage.cpp @@ -278,7 +278,7 @@ std::vector<CTransactionRef> TxOrphanage::GetChildrenFromSamePeer(const CTransac // Convert to a vector of CTransactionRef std::vector<CTransactionRef> children_found; children_found.reserve(iters.size()); - for (const auto child_iter : iters) { + for (const auto& child_iter : iters) { children_found.emplace_back(child_iter->second.tx); } return children_found; @@ -310,7 +310,7 @@ std::vector<std::pair<CTransactionRef, NodeId>> TxOrphanage::GetChildrenFromDiff // Convert iterators to pair<CTransactionRef, NodeId> std::vector<std::pair<CTransactionRef, NodeId>> children_found; children_found.reserve(iters.size()); - for (const auto child_iter : iters) { + for (const auto& child_iter : iters) { children_found.emplace_back(child_iter->second.tx, child_iter->second.fromPeer); } return children_found; |