Re: [Kicad-developers] [PATCH] Logic reformulation in Plot_Edges_Modules

2016-04-13 Thread Lorenzo Marcantonio
On Tue, Apr 12, 2016 at 09:16:00PM +, 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


signature.asc
Description: PGP signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Logic reformulation in Plot_Edges_Modules

2016-04-12 Thread Chris Pavlina
Indeed.

a   b   !(!a || !b) a && b
0   0   0   0
0   1   0   0
1   0   0   0
1   1   1   1


Please be careful. I'm guessing that this patch was untested.

On Tue, Apr 12, 2016 at 04:23:18PM -0500, José Ignacio wrote:
> I don't believe that's correct !(!a || !b) is equal to a && b (de
> morgan) 
> http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/ietron/demorgan2.gif
> 
> On Tue, Apr 12, 2016 at 4:16 PM, Pereira, Patrick
>  wrote:
> > Hi,
> >
> > Corrections to avoid unnecessary boolean operations
> > !(!a || !b) = a || b
> >
> > Best Regards,
> > ___
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to : kicad-developers@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
> 
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Logic reformulation in Plot_Edges_Modules

2016-04-12 Thread José Ignacio
I don't believe that's correct !(!a || !b) is equal to a && b (de
morgan) 
http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/ietron/demorgan2.gif

On Tue, Apr 12, 2016 at 4:16 PM, Pereira, Patrick
 wrote:
> Hi,
>
> Corrections to avoid unnecessary boolean operations
> !(!a || !b) = a || b
>
> Best Regards,
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] [PATCH] Logic reformulation in Plot_Edges_Modules

2016-04-12 Thread Pereira, Patrick
Hi,

Corrections to avoid unnecessary boolean operations
!(!a || !b) = a || b

Best Regards,From 5903b024c6f2dcd3010a4700b4a5feb032594b33 Mon Sep 17 00:00:00 2001
From: "Patrick J.P" 
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

Signed-off-by: Patrick J.P 
---
 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..3628beb 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( 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

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp