title: Put if absent to map in scala
body: <p>I have the following map:</p>
  
  <pre><code>val m: mutable.Map[String, Long] = mutable.Map()
  </code></pre>
  
  <p>and I want to just put some value into it if it's not present. If it is present in turn I want to perform some computations:</p>
  
  <p>Currently I do it in the following way:</p>
  
  <pre><code>val key: String = //...
  val value: Long = //...
  m(key) = m.getOrElse(key, 0L) + value
  </code></pre>
  
  <p>But this feels a bit verbose to me (In Java we have <code>putIfAbsent</code> method). Is there a shorter way to do so in Scala?</p>