mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Fix detection of SEF in assignments with vector/rot fields as LHS.
This commit is contained in:
parent
7a4a6d221e
commit
c080f4b596
1 changed files with 7 additions and 2 deletions
|
@ -485,8 +485,13 @@ class optimizer(renamer, deadcode):
|
|||
|
||||
# We have a regular assignment either way now. Simplify the RHS.
|
||||
self.FoldTree(node['ch'], 1)
|
||||
if child[1]['nt'] == 'IDENT' and child[1]['name'] == child[0]['name'] \
|
||||
and child[1]['scope'] == child[0]['scope']:
|
||||
if child[0]['nt'] == child[1]['nt'] == 'IDENT' \
|
||||
and child[1]['name'] == child[0]['name'] \
|
||||
and child[1]['scope'] == child[0]['scope'] \
|
||||
or child[0]['nt'] == child[1]['nt'] == 'FLD' \
|
||||
and child[1]['ch'][0]['name'] == child[0]['ch'][0]['name'] \
|
||||
and child[1]['ch'][0]['scope'] == child[0]['ch'][0]['scope'] \
|
||||
and child[1]['fld'] == child[0]['fld']:
|
||||
node['SEF'] = True
|
||||
self.FoldStmt(parent, index)
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue