Permalink
Browse files

Fixes SI-6521, overrides Range#head to be faster

Backport of 63ba3d6
  • Loading branch information...
dlwh authored and JamesIry committed Oct 12, 2012
1 parent 1381cda commit a557a973608a75c7a02f251bbcf49fe6f6b6655e
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/library/scala/collection/immutable/Range.scala
@@ -77,6 +77,7 @@ extends scala.collection.AbstractSeq[Int]
final val terminalElement = start + numRangeElements * step
override def last = if (isEmpty) Nil.last else lastElement
+ override def head = if (isEmpty) Nil.head else start
override def min[A1 >: Int](implicit ord: Ordering[A1]): Int =
if (ord eq Ordering.Int) {

0 comments on commit a557a97

Please sign in to comment.