- def reduceLeft[B >: A](op: (B, A) => B): B = {
- if (isEmpty)
- throw new UnsupportedOperationException("empty.reduceLeft")
- var first = true
- var acc: B = 0.asInstanceOf[B]
- for (x <- self) {
- if (first) {
- acc = x
- first = false
- }
- else acc = op(acc, x)
- }
- acc
- }