Scala newbie - if-else
<p>A scala method gets an input and should operate either on the input directly or a calculation of it, for instance consider the following code:</p>

<pre><code>def foo (b : Boolean, input : Any): Unit ={
  val changedInput = {if (b) input else bar(input) }
  dowork (changedInput)
}
</code></pre>

<p>Is it appropriate to use an anonymous function like in the example above or there another syntax?</p>