title: How immediatly return accumulator from foldLeft
body: <p>How optimize following code in good, functional way?</p>
  <pre><code>  List(1,2,3,4,5).foldLeft(0) {
      case (acc, e) =&gt;
        if(acc &gt; 5) acc
        else acc + e
    }
  </code></pre>
  <p>It is of course simple example, I am asking for general way, how do not iterate all collection if we known that accumulator will not change</p>