From 2948399bf87c0eae5b7e9e3ed2020842826a7c5a Mon Sep 17 00:00:00 2001 From: Sei Lisa Date: Fri, 13 Mar 2015 22:13:00 +0100 Subject: [PATCH] Revert 3b7e461d82528ba1b3f8a71d4634bc35f3482e9a, as it introduced bugs. --- lslopt/lslfoldconst.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lslopt/lslfoldconst.py b/lslopt/lslfoldconst.py index 0bc8f9b..fdabeea 100644 --- a/lslopt/lslfoldconst.py +++ b/lslopt/lslfoldconst.py @@ -159,7 +159,7 @@ class foldconst(object): self.FoldTree(child, 0) if 'SEF' in child[0]: node['SEF'] = True - if child[0]['nt'] == 'CONST' and (node['t'] != 'list' or self.globalmode): + if child[0]['nt'] == 'CONST': # Enable key constants. We'll typecast them back on output, but # this enables some optimizations. #if node['t'] != 'key': # key constants not possible @@ -832,16 +832,11 @@ class foldconst(object): value = [elem['value'] for elem in child] if nt == 'VECTOR': value = lslfuncs.Vector([lslfuncs.ff(x) for x in value]) - parent[index] = {'nt':'CONST', 'SEF':True, 't':node['t'], - 'value':value} - return elif nt == 'ROTATION': value = lslfuncs.Quaternion([lslfuncs.ff(x) for x in value]) - parent[index] = {'nt':'CONST', 'SEF':True, 't':node['t'], - 'value':value} - return - if nt == 'LIST' and len(child) == 1 and not self.globalmode: - node = parent[index] = self.Cast(child[0], 'list') + parent[index] = {'nt':'CONST', 'SEF':True, 't':node['t'], + 'value':value} + return if issef: node['SEF'] = True return