diff --git a/libs/kimath/include/geometry/shape_poly_set.h b/libs/kimath/include/geometry/shape_poly_set.h index 2192837918..a3665b58dc 100644 --- a/libs/kimath/include/geometry/shape_poly_set.h +++ b/libs/kimath/include/geometry/shape_poly_set.h @@ -138,7 +138,7 @@ public: void GetTriangle( int index, VECTOR2I& a, VECTOR2I& b, VECTOR2I& c ) const { - auto tri = m_triangles[ index ]; + auto& tri = m_triangles[ index ]; a = m_vertices[ tri.a ]; b = m_vertices[ tri.b ]; c = m_vertices[ tri.c ]; diff --git a/qa/tests/pcbnew/test_pns_basics.cpp b/qa/tests/pcbnew/test_pns_basics.cpp index 2d4e64dc84..40802406d0 100644 --- a/qa/tests/pcbnew/test_pns_basics.cpp +++ b/qa/tests/pcbnew/test_pns_basics.cpp @@ -364,7 +364,7 @@ BOOST_FIXTURE_TEST_CASE( PNSHoleCollisions, PNS_TEST_FIXTURE ) dumpObstacles( obstacles ); BOOST_CHECK_EQUAL( obstacles.size(), 1 ); - const auto first = *obstacles.begin(); + const auto& first = *obstacles.begin(); BOOST_CHECK_EQUAL( first.m_head, v1 ); BOOST_CHECK_EQUAL( first.m_item, v2 ); @@ -382,7 +382,7 @@ BOOST_FIXTURE_TEST_CASE( PNSHoleCollisions, PNS_TEST_FIXTURE ) BOOST_CHECK_EQUAL( obstacles.size(), 1 ); auto iter = obstacles.begin(); - const auto first = *iter++; + const auto& first = *iter++; BOOST_CHECK_EQUAL( first.m_head, v1->Hole() ); BOOST_CHECK_EQUAL( first.m_item, v2->Hole() ); @@ -400,7 +400,7 @@ BOOST_FIXTURE_TEST_CASE( PNSHoleCollisions, PNS_TEST_FIXTURE ) BOOST_CHECK_EQUAL( obstacles.size(), 2 ); auto iter = obstacles.begin(); - const auto first = *iter++; + const auto& first = *iter++; // There is no guarantee on what order the two collisions will be in... BOOST_CHECK( ( first.m_head == v1 && first.m_item == v2->Hole() )