1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-16 20:07:31 +02:00
eda-tools/kicad-patches/streamline-erc.patch

53 lines
1.6 KiB
Diff

streamline TestOthersItems (ERC)
This patch changes a deeply nested "if" into a series of "breaks",
for better readability and to facilitate future extensions.
- Werner
---
Index: kicad/eeschema/erc.cpp
===================================================================
--- kicad.orig/eeschema/erc.cpp 2010-04-28 05:40:28.000000000 -0300
+++ kicad/eeschema/erc.cpp 2010-04-28 05:40:38.000000000 -0300
@@ -653,23 +653,22 @@
break;
*NetNbItems += 1;
+ if( erc != OK )
+ break;
+
+ erc = DiagErc[ref_elect_type][jj];
if( erc == OK )
- {
- erc = DiagErc[ref_elect_type][jj];
- if( erc != OK )
- {
- if( g_NetObjectslist[NetItemTst]->m_FlagOfConnection == 0 )
- {
- Diagnose( panel,
- g_NetObjectslist[NetItemRef],
- g_NetObjectslist[NetItemTst],
- 0,
- erc );
- g_NetObjectslist[NetItemTst]->m_FlagOfConnection =
- NOCONNECT_SYMBOL_PRESENT;
- }
- }
- }
+ break;
+ if( g_NetObjectslist[NetItemTst]->m_FlagOfConnection != 0 )
+ break;
+
+ Diagnose( panel,
+ g_NetObjectslist[NetItemRef],
+ g_NetObjectslist[NetItemTst],
+ 0,
+ erc );
+ g_NetObjectslist[NetItemTst]->m_FlagOfConnection =
+ NOCONNECT_SYMBOL_PRESENT;
break;
}
}