Skip to content

Commit

Permalink
fix logic error in retaining switches
Browse files Browse the repository at this point in the history
  • Loading branch information
derrickoswald committed Jan 29, 2018
1 parent 05f5ca9 commit 7495c7d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ with
*/
def switchClosed (switch: Switch): Boolean =
{
if (0 != (switch.bitfields(openMask / 32) | (1 << (openMask % 32))))
if (0 != (switch.bitfields(openMask / 32) & (1 << (openMask % 32))))
!switch.open // open valid
else if (0 != (switch.bitfields(normalOpenMask / 32) | (1 << (normalOpenMask % 32))))
else if (0 != (switch.bitfields(normalOpenMask / 32) & (1 << (normalOpenMask % 32))))
!switch.normalOpen
else
true
Expand All @@ -118,7 +118,7 @@ with
*/
def retainSwitch (switch: Switch): Boolean =
{
if (0 != (switch.bitfields(retainedMask / 32) | (1 << (retainedMask % 32))))
if (0 != (switch.bitfields(retainedMask / 32) & (1 << (retainedMask % 32))))
switch.retained
else
false
Expand Down

0 comments on commit 7495c7d

Please sign in to comment.