Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization problem: eliminate jumps to the very next line #50

Closed
00001H opened this issue Apr 29, 2022 · 0 comments
Closed

Optimization problem: eliminate jumps to the very next line #50

00001H opened this issue Apr 29, 2022 · 0 comments

Comments

@00001H
Copy link

00001H commented Apr 29, 2022

I compile this code:

CENTER = foundation1
if uradar(enemy,any,any,distance,0,1,rslt)
    if len(rslt.x - @unit.x,rslt.y - @unit.y) < 20
        end()
    end
end

if ulocate(damaged, dmgx, dmgy, dmgbuilding)
    approach(dmgx, dmgy, 5)
    target(dmgx, dmgy, true)
else
    approach(CENTER.x + 10 * sin(@tick), CENTER.y + 10 * cos(@tick), 2)
end

and the result contains the following lines:
jump 14 always 0 0
jump 15 always 0 0
They are both jumps to the very next line, and would be very unneccesary(and will slow down the processor).
They should be deleted by the optimizer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant