removing vias from a copy of the list to avoid to invalidate the iterators in C++
This commit is contained in:
1 parent
f3d0485ff7
commit
da2a1335e2
2 files changed
+7
-6
No files matched your search
@@ -349,11 +349,12 @@ STEP = '-'
|
||||
# timestmap again available
|
||||
#target_tracks = filter(lambda x: (x.GetNetname().upper() == self.netname), self.pcb.GetTracks())
|
||||
target_tracks = filter(lambda x: (x.GetNetname() == self.netname), self.pcb.GetTracks())
|
||||
for via in target_tracks:
|
||||
# pprint.pprint(via.GetTimeStamp())
|
||||
if via.Type() == PCB_VIA_T:
|
||||
if via.GetTimeStamp() == 33:
|
||||
self.pcb.RemoveNative(via)
|
||||
target_tracks_cp = list(target_tracks)
|
||||
l = len (target_tracks_cp)
|
||||
for i in range(l):
|
||||
if target_tracks_cp[i].Type() == PCB_VIA_T:
|
||||
if target_tracks_cp[i].GetTimeStamp() == 33:
|
||||
self.pcb.RemoveNative(target_tracks_cp[i])
|
||||
self.RefillBoardAreas()
|
||||
return # no need to run the rest of logic
|
||||
|
||||
|
||||
Reference in new issue
Block a user