mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Add some early returns for performance.
This commit is contained in:
parent
a87022b73f
commit
9c66380972
1 changed files with 6 additions and 0 deletions
|
@ -38,25 +38,31 @@ class lastpass(object):
|
||||||
# is found while monitoring state changes.
|
# is found while monitoring state changes.
|
||||||
self.subinfo['StChAreBad'] = 'scope' in node
|
self.subinfo['StChAreBad'] = 'scope' in node
|
||||||
self.BadStCh = False
|
self.BadStCh = False
|
||||||
|
return
|
||||||
|
|
||||||
if nt == 'IF':
|
if nt == 'IF':
|
||||||
if len(child) == 2:
|
if len(child) == 2:
|
||||||
# Don't monitor the children.
|
# Don't monitor the children.
|
||||||
self.subinfo['StChAreBad'] = False
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
if nt == 'DO':
|
if nt == 'DO':
|
||||||
self.subinfo['StChAreBad'] = False
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
if nt == 'FOR':
|
if nt == 'FOR':
|
||||||
self.subinfo['StChAreBad'] = False
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
if nt == 'WHILE':
|
if nt == 'WHILE':
|
||||||
self.subinfo['StChAreBad'] = False
|
self.subinfo['StChAreBad'] = False
|
||||||
|
return
|
||||||
|
|
||||||
if nt == 'STSW':
|
if nt == 'STSW':
|
||||||
if self.subinfo['StChAreBad']:
|
if self.subinfo['StChAreBad']:
|
||||||
# Found one.
|
# Found one.
|
||||||
self.BadStCh = True
|
self.BadStCh = True
|
||||||
|
return
|
||||||
|
|
||||||
if (self.optlistadd and not self.globalmode
|
if (self.optlistadd and not self.globalmode
|
||||||
and (nt == 'CONST' and node['t'] == 'list' or nt == 'LIST'
|
and (nt == 'CONST' and node['t'] == 'list' or nt == 'LIST'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue