The llGetListLength optimization can be applied to arbitrary expressions.

This commit is contained in:
Sei Lisa 2015-07-13 07:16:32 +02:00
parent d35ab22c42
commit 1636e56266

View file

@ -951,8 +951,8 @@ class foldconst(object):
except lslfuncs.ELSLCantCompute:
# Don't transform the tree if function is not computable
pass
elif node['name'] == 'llGetListLength' and child[0]['nt'] == 'IDENT':
# Convert llGetListLength(ident) to (ident != [])
elif node['name'] == 'llGetListLength':
# Convert llGetListLength(expr) to (expr != [])
node = {'nt':'CONST', 't':'list', 'value':[]}
parent[index] = node = {'nt':'!=', 't':'list', 'ch':[child[0], node]}
elif SEFargs and 'SEF' in self.symtab[0][node['name']]: