mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Mark returned constant node as side effect-free.
When a function was successfully applied, the resulting constant node was not marked as side effect-free. This could potentially lead to poor optimization.
This commit is contained in:
parent
65d3f1130a
commit
13f3c951e1
1 changed files with 1 additions and 1 deletions
|
@ -1000,7 +1000,7 @@ class foldconst(object):
|
|||
if self.warntabs:
|
||||
warning(u"Can't optimize call to %s because it would generate a tab character (you can force the optimization with the 'foldtabs' option, or disable this warning by disabling the 'warntabs' option)." % node['name'].decode('utf8'))
|
||||
return
|
||||
parent[index] = {'nt':'CONST', 't':node['t'], 'value':value}
|
||||
parent[index] = {'nt':'CONST', 't':node['t'], 'value':value, 'SEF':True}
|
||||
elif node['name'] == 'llGetListLength':
|
||||
# Convert llGetListLength(expr) to (expr != [])
|
||||
node = {'nt':'CONST', 't':'list', 'value':[]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue