title: Case class: performances of always copying vs check for differences before copying
body: <p>Lets say i have the following class:</p>
  <pre><code>case class Foo(words: List[String])
  </code></pre>
  <p>I want to make a method member of this class that removes an element from the list. I am wondering if there is a notable difference between these two implementations:</p>
  <pre><code>def withoutWord(w: String): Foo = copy(words = words.filterNot(_ == w))
  </code></pre>
  <pre><code>def withoutWord(w: String): Foo = {
    if(words contains w) copy(words = words.filterNot(_ == w))
    else this
  }
  </code></pre>
  <p>Is it better to check for modifications and return the current instance if nothing has changed or save this time and always copy? In my case, words should rarely exceeds 20 elements and the class has several other fields.</p>