title: How do I convert the following var Scala code into vals?
body: <pre><code>var exit: String = expensiveOperation
  if (exit.contains(...)) exit = somethingElse
  </code></pre>
  
  <p>The key is I only wish to call</p>
  
  <p>expensiveOperation</p>
  
  <p>once since it consumes many clock cycles</p>