Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
Fix confused logic
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jan 17, 2017
1 parent 413e53d commit 778c601
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/scala/strawman/collection/Iterable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,10 @@ trait IterableMonoTransforms[+A, +Repr] extends Any {
def drop(n: Int): Repr = fromIterableWithSameElemType(View.Drop(coll, n))

/** The rest of the collection without its first element. */
def tail: Repr =
if (coll.isEmpty) drop(1)
else throw new UnsupportedOperationException
def tail: Repr = {
if (coll.isEmpty) throw new UnsupportedOperationException
drop(1)
}
}

/** Transforms over iterables that can return collections of different element types.
Expand Down

0 comments on commit 778c601

Please sign in to comment.