Skip to content

Commit

Permalink
Fixes SI-6521, overrides Range#head to be faster
Browse files Browse the repository at this point in the history
Backport of 63ba3d6
  • Loading branch information
dlwh authored and JamesIry committed Jan 8, 2013
1 parent 1381cda commit a557a97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/library/scala/collection/immutable/Range.scala
Expand Up @@ -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) {
Expand Down

0 comments on commit a557a97

Please sign in to comment.