llDumpList2String: Always optimize SEF lists of 1 element

This commit is contained in:
Sei Lisa 2018-11-19 02:23:23 +01:00
parent 64c9c1db8b
commit 1ebd029931

View file

@ -169,6 +169,12 @@ def OptimizeFunc(self, parent, index):
parent[index] = nr(nt='CONST', t='string', value=u'', SEF=True)
return
if list_len == 1:
# A single-element list can always be transformed regardless of
# the presence of function calls
parent[index] = CastDL2S(self, child[0], 0)
return
# Only optimize if the second param is a very simple expression,
# otherwise the sums can get large.
if child[1].nt in ('CONST', 'IDENT'):