diff --git a/pcbnew/connectivity/from_to_cache.cpp b/pcbnew/connectivity/from_to_cache.cpp index bec487523e..bee76f3b28 100644 --- a/pcbnew/connectivity/from_to_cache.cpp +++ b/pcbnew/connectivity/from_to_cache.cpp @@ -74,16 +74,16 @@ static PATH_STATUS uniquePathBetweenNodes( CN_ITEM* u, CN_ITEM* v, std::vector; std::deque Q; - Path p; - int pathFound = false; - p.push_back( u ); - Q.push_back( p ); + Path pInit; + int pathFound = false; + pInit.push_back( u ); + Q.push_back( pInit ); while( Q.size() ) { Path path = Q.front(); Q.pop_front(); - CN_ITEM *last = path.back(); + CN_ITEM* last = path.back(); if( last == v ) { @@ -95,21 +95,22 @@ static PATH_STATUS uniquePathBetweenNodes( CN_ITEM* u, CN_ITEM* v, std::vectorConnectedItems() ) { - bool vertexVisited = isVertexVisited(ci, path); + bool vertexVisited = isVertexVisited( ci, path ); - for( auto &p : Q ) - if (isVertexVisited(ci, p)) + for( auto& p : Q ) + if( isVertexVisited( ci, p ) ) { vertexVisited = true; break; } - if (!vertexVisited) { - Path newpath(path); - newpath.push_back(ci); - Q.push_back(newpath); - } - } + if( !vertexVisited ) + { + Path newpath( path ); + newpath.push_back( ci ); + Q.push_back( newpath ); + } + } } return pathFound ? PS_OK : PS_NO_PATH;