Skip to content

Commit

Permalink
Fix some xor arg set errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdrake committed May 25, 2015
1 parent f82db11 commit 42f714a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions extension/boolexpr/argset.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,19 @@ BoolExprXorArgSet_Insert(struct BoolExprXorArgSet *argset, struct BoolExpr *key)
}

// Xor(x, y, z, z) = Xor(x, y)
// Xnor(x, y, z, z) = Xor(x, y)
// Xnor(x, y, z, z) = Xnor(x, y)
if (BoolExprSet_Contains(argset->xs, key)) {
BoolExprSet_Remove(argset->xs, key);
argset->parity = true;
return true;
}

// Xor(x, y, z, ~z) =
// Xnor(x, y, z, ~z) =
// Xor(x, y, z, ~z) = Xnor(x, y)
// Xnor(x, y, z, ~z) = Xor(x, y)
if (IS_LIT(key) || IS_NOT(key)) {
struct BoolExpr *ex = Not(key);
if (BoolExprSet_Contains(argset->xs, ex)) {
BoolExprSet_Remove(argset->xs, ex);
argset->parity = false;
argset->parity ^= true;
BoolExpr_DecRef(ex);
return true;
}
Expand Down

0 comments on commit 42f714a

Please sign in to comment.