From 3cca2ace441b124c9405f86c6210c03c3f728034 Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Sun, 27 Sep 2020 17:49:54 +0200 Subject: [PATCH] pcbnew: fix warnings in FROM_TO_CACHE --- pcbnew/connectivity/from_to_cache.cpp | 29 ++++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) 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;