Skip to content

Commit 1b759ac

Browse files
committed
test: Avoid copies
1 parent c47d9c2 commit 1b759ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/internal/testTopoView.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class NodeImpl : public AutoDiff::internal::Node {
2525

2626
// needed for test::Graph
2727
NodeImpl(int id, std::vector<int>* /*dtorSeqPtr*/)
28-
: mId{id} {};
28+
: mId{id} { };
2929

3030
~NodeImpl() override = default;
3131

@@ -48,15 +48,15 @@ using Graph = test::Graph<test::TopoView::NodeImpl>;
4848
using AutoDiff::internal::CyclicGraphError;
4949

5050
template <typename... Nodes>
51-
auto rootSet(std::shared_ptr<Nodes>... nodePtrs)
51+
auto rootSet(std::shared_ptr<Nodes> const&... nodePtrs)
5252
{
5353
typename TopoView::Roots roots{};
5454
(roots.obj.insert(nodePtrs.get()), ...);
5555
return roots;
5656
}
5757

5858
template <typename... Nodes>
59-
auto leafSet(std::shared_ptr<Nodes>... nodePtrs)
59+
auto leafSet(std::shared_ptr<Nodes> const&... nodePtrs)
6060
{
6161
typename TopoView::Leaves leaves{};
6262
(leaves.obj.insert(nodePtrs.get()), ...);

0 commit comments

Comments
 (0)