← Back to team overview

kicad-developers team mailing list archive

[PATCH 13/16] Avoid static variable in wire merge

 

There is little to no reason why this variable should be static, given that
it is cleared after each iteration.
---
 eeschema/sch_line.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/eeschema/sch_line.cpp b/eeschema/sch_line.cpp
index 72efb5c..050b786 100644
--- a/eeschema/sch_line.cpp
+++ b/eeschema/sch_line.cpp
@@ -346,8 +346,7 @@ bool SCH_LINE::MergeOverlap( SCH_LINE* aLine )
     // for horizontal segments the uppermost and the lowest point
     if( colinear )
     {
-        static std::vector <wxPoint*> candidates;
-        candidates.clear();
+        std::vector <wxPoint*> candidates;
         candidates.push_back( &m_start );
         candidates.push_back( &m_end );
         candidates.push_back( &aLine->m_start );

Follow ups

References