mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Two more optimizations TODO
This commit is contained in:
parent
e36fc83b39
commit
7e521780d6
1 changed files with 3 additions and 0 deletions
|
@ -108,6 +108,8 @@ class foldconst(object):
|
|||
# when possible. Or if one is bool and the other is not, to an
|
||||
# expression of the form !(a&-b) (if b is bool).
|
||||
|
||||
# TODO: Convert bool(x < 0) to bool(x & 0x80000000)
|
||||
|
||||
|
||||
def CopyNode(self, node):
|
||||
# This is mainly for simple_expr so no need to go deeper than 1 level.
|
||||
|
@ -851,6 +853,7 @@ class foldconst(object):
|
|||
return
|
||||
|
||||
if nt == 'IF':
|
||||
# TODO: Swap IF/ELSE if both present and nonempty and cond starts with !
|
||||
self.FoldTree(child, 0)
|
||||
self.FoldCond(child, 0)
|
||||
if child[0]['nt'] == 'CONST':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue