title: Any performance cost with using "when" instead of "if-else"?
body: <p>While developing, I've found that using <code>when</code> looks nicer a lot of the times compared to <code>if-else</code>. So, I'm curious whether using <code>when</code> instead of the typical <code>if-else</code> in simple situations have a performance impact (even if it's small). An example is doing:</p>
  
  <pre><code>val someNumber = when (someObject) {
      null -&gt; 0
      else -&gt; someCalculation()
  }
  </code></pre>
  
  <p>versus</p>
  
  <pre><code>val someNumber = if (someObject == null) {
      0
  } else {
      someCalculation()
  }
  </code></pre>
  
  <p>Is there a performance difference between the two?</p>