fix to optimization

git-svn-id: http://galileo.dmi.unict.it/svn/relational/trunk@186 014f5005-505e-4b48-8d0a-63407b615a7c
master
LtWorf 2009-05-30 15:17:51 +07:00
parent 10227d1ae7
commit 7659e39bd3
1 changed files with 2 additions and 2 deletions

@ -90,13 +90,13 @@ def futile_union_intersection_subtraction(n):
replace_node(n,n.left)
elif (n.name == '' and ((n.left.name=='σ' and n.left.child==n.right) or (n.right.name=='σ' and n.right.child==n.left))): #Union of two equal things, but one has a selection
changes=1
if n.left!='σ':#Selection on left. replacing self with right.
if n.left=='σ':#Selection on left. replacing self with right.
replace_node(n,n.right)
else:#Selection on left. replacing self with right.
replace_node(n,n.left)
elif (n.name == '' and ((n.left.name=='σ' and n.left.child==n.right) or (n.right.name=='σ' and n.right.child==n.left))): #Intersection of two equal things, but one has a selection
changes=1
if n.left!='σ':#Swapping with the selection
if n.left=='σ':#Swapping with the selection
replace_node(n,n.left)
else:
replace_node(n,n.right)