Avoid a possibly unnecessary expansion
When transforming if(!non-bool | !bool) to if(!(non-bool & -bool)), don't negate the bool if non-bool is actually an AND-bool.
This commit is contained in:
@@ -504,7 +504,7 @@ class foldconst(object):
|
||||
if not self.IsBool(child[b].ch[0]):
|
||||
a, b = 1, 0
|
||||
if self.IsBool(child[b].ch[0]):
|
||||
if not self.IsBool(child[a].ch[0]):
|
||||
if not self.IsAndBool(child[a].ch[0]):
|
||||
child[b].ch[0] = nr(nt='NEG', t='integer',
|
||||
ch=[child[b].ch[0]])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user