From 1636e5626697fb08180b6f0f446266707abb26a2 Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Mon, 13 Jul 2015 07:16:32 +0200 Subject: [PATCH] The llGetListLength optimization can be applied to arbitrary expressions. --- lslopt/lslfoldconst.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index d15f959..fa0794d 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -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']]: