title: switch case vs if else
body: <p>I was wondering if there was any difference in the way the following code was compiled into assembly. I've heard that switch-case is more efficient than if else, but in this example I am not quite sure if that would be the case.</p>
  
  <pre><code>if(x==1){
  ...
  }else if(x==2){
  ...
  }else{
  ...
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>switch(x){
   case 1:
   ...
   break;
  
   case 2:
   ...
   break;
  
   default:
   ...
  }
  </code></pre>