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

Optimize if-else blocks #7

Open
anton-k opened this issue Apr 2, 2014 · 0 comments
Open

Optimize if-else blocks #7

anton-k opened this issue Apr 2, 2014 · 0 comments

Comments

@anton-k
Copy link
Contributor

anton-k commented Apr 2, 2014

Right now all expressions that go into if-else blocks are executed.
For all branches. It's better to place the expressions in separate branches:

It should be:

if (cond) {
  a1 = b1
  res = a1
} else {
  a2 = b2
  res = a2
}

But right now it's

a1 = b1
a2 = b2
if (cond) {
  res = a1
} else {  
  res = a2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant