mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Allow -2147483648 to count as a power of 2 in an optimization.
A case we oversought when implementing absorption of more than two flag tests into a single number.
This commit is contained in:
parent
2bee2db148
commit
e8fb659592
1 changed files with 2 additions and 1 deletions
|
@ -379,7 +379,8 @@ class foldconst(object):
|
|||
ch1 = child[a]['ch'][0]['ch']
|
||||
ch2 = child[b]['ch'][0]['ch']
|
||||
if (ch1[d]['nt'] == 'CONST' and ch2[f]['nt'] == 'CONST'
|
||||
and (ch2[f]['value'] & (ch2[f]['value'] - 1)) == 0
|
||||
and (ch2[f]['value'] & (ch2[f]['value'] - 1)
|
||||
& 0xFFFFFFFF) == 0
|
||||
):
|
||||
if self.CompareTrees(ch1[c], ch2[e]):
|
||||
# We're in that case. Apply optimization.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue