kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #24173
RES: [PATCH] Logic reformulation in Plot_Edges_Modules
Ooooops, sorry for my inattention.
Correction in attachment.
________________________________________
De: Kicad-developers [kicad-developers-bounces+patrick.pereira=intel.com@xxxxxxxxxxxxxxxxxxx] em nome de Lorenzo Marcantonio [l.marcantonio@xxxxxxxxxxxxx]
Enviado: quarta-feira, 13 de abril de 2016 3:19
Para: Kicad Developers
Assunto: Re: [Kicad-developers] [PATCH] Logic reformulation in Plot_Edges_Modules
On Tue, Apr 12, 2016 at 09:16:00PM +0000, Pereira, Patrick wrote:
> Hi,
>
> Corrections to avoid unnecessary boolean operations
> !(!a || !b) = a || b
You just insulted DeMorgan :D Hope the code is better
--
Lorenzo Marcantonio
CZ Srl - Parma
From 5b4238d5aca1f26d977463e999295ea944f081b2 Mon Sep 17 00:00:00 2001
From: "Patrick J.P" <patrick.pereira@xxxxxxxxx>
Date: Tue, 12 Apr 2016 18:08:49 -0300
Subject: [PATCH 1/1] Logic reformulation in Plot_Edges_Modules
Corrections to avoid unnecessary boolean operations
!(!a || !b) = a && b
+---+---+-------------+--------+
| A | B | !(!A || !B) | A && B |
+---+---+-------------+--------+
| 0 | 0 | 0 | 0 |
+---+---+-------------+--------+
| 0 | 1 | 0 | 0 |
+---+---+-------------+--------+
| 1 | 0 | 0 | 0 |
+---+---+-------------+--------+
| 1 | 1 | 1 | 1 |
+---+---+-------------+--------+
Signed-off-by: Patrick J.P <patrick.pereira@xxxxxxxxx>
---
pcbnew/plot_brditems_plotter.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/pcbnew/plot_brditems_plotter.cpp b/pcbnew/plot_brditems_plotter.cpp
index e9d82c3..4634c39 100644
--- a/pcbnew/plot_brditems_plotter.cpp
+++ b/pcbnew/plot_brditems_plotter.cpp
@@ -354,10 +354,8 @@ void BRDITEMS_PLOTTER::Plot_Edges_Modules()
{
EDGE_MODULE* edge = dyn_cast<EDGE_MODULE*>( item );
- if( !edge || !m_layerMask[edge->GetLayer()] )
- continue;
-
- Plot_1_EdgeModule( edge );
+ if( edge && m_layerMask[edge->GetLayer()] )
+ Plot_1_EdgeModule( edge );
}
}
}
--
2.8.0
Follow ups
References