Skip to content

Commit 7f6fb73

Browse files
committed
[refactor] use reference in for loop through iters
1 parent 6119f76 commit 7f6fb73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/txorphanage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ std::vector<CTransactionRef> TxOrphanage::GetChildrenFromSamePeer(const CTransac
278278
// Convert to a vector of CTransactionRef
279279
std::vector<CTransactionRef> children_found;
280280
children_found.reserve(iters.size());
281-
for (const auto child_iter : iters) {
281+
for (const auto& child_iter : iters) {
282282
children_found.emplace_back(child_iter->second.tx);
283283
}
284284
return children_found;
@@ -310,7 +310,7 @@ std::vector<std::pair<CTransactionRef, NodeId>> TxOrphanage::GetChildrenFromDiff
310310
// Convert iterators to pair<CTransactionRef, NodeId>
311311
std::vector<std::pair<CTransactionRef, NodeId>> children_found;
312312
children_found.reserve(iters.size());
313-
for (const auto child_iter : iters) {
313+
for (const auto& child_iter : iters) {
314314
children_found.emplace_back(child_iter->second.tx, child_iter->second.fromPeer);
315315
}
316316
return children_found;

0 commit comments

Comments
 (0)