mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 15:48:21 +00:00
Remove "magic names" where possible, using new data from fndata.txt
This commit is contained in:
parent
b80b157489
commit
70f39d7f5e
6 changed files with 50 additions and 58 deletions
|
@ -267,7 +267,7 @@ class foldconst(object):
|
|||
return # Nothing to do if it's already simplified.
|
||||
child = node['ch'] if 'ch' in node else None
|
||||
|
||||
if nt == 'FNCALL' and node['name'] == 'llStringLength':
|
||||
if nt == 'FNCALL' and 'strlen' in self.symtab[0][node['name']]:
|
||||
# llStringLength(expr) -> !(expr == "")
|
||||
node = {'nt':'==', 't':'integer',
|
||||
'ch':[child[0],
|
||||
|
@ -1427,8 +1427,10 @@ class foldconst(object):
|
|||
|
||||
try:
|
||||
# May raise ELSLCantCompute
|
||||
if name[:10] == 'llDetected':
|
||||
value = fn(*args, event=self.CurEvent)
|
||||
if 'detect' in self.symtab[0][name]:
|
||||
value = fn(*args,
|
||||
evsym=None if self.CurEvent is None
|
||||
else self.events[self.CurEvent])
|
||||
else:
|
||||
value = fn(*args)
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue