Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions src/library/scala/collection/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,6 @@ package object collection {
*/
type AnyConstr[X] = Any

/** Collection internal utility functions.
*/
private[collection] object DebugUtils {
def unsupported(msg: String) = throw new UnsupportedOperationException(msg)
def noSuchElement(msg: String) = throw new NoSuchElementException(msg)
def indexOutOfBounds(index: Int) = throw new IndexOutOfBoundsException(index.toString)
def illegalArgument(msg: String) = throw new IllegalArgumentException(msg)

def buildString(closure: (Any => Unit) => Unit): String = {
val output = new collection.mutable.StringBuilder
closure { any =>
output ++= any.toString
output += '\n'
}

output.result()
}

def arrayString[T](array: Array[T], from: Int, until: Int): String = {
array.slice(from, until) map ({
case null => "n/a"
case x => "" + x
}: scala.PartialFunction[T, String]) mkString " | "
}
}

/** An extractor used to head/tail deconstruct sequences. */
object +: {
/** Splits a sequence into head :+ tail.
Expand Down