summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/util
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-09-27 12:28:55 -0700
committerPaul Phillips <paulp@improving.org>2013-10-02 08:59:55 -0700
commitaced32d05c97651534f468bc9a475ea5f6ae75b8 (patch)
treefda8b628ae8501a8df945aeb7f558f259c857e62 /src/reflect/scala/reflect/internal/util
parent45183d8d28ff082d9186018b707f9fecb466f14f (diff)
downloadscala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.gz
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.tar.bz2
scala-aced32d05c97651534f468bc9a475ea5f6ae75b8.zip
Removing unused code.
Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
Diffstat (limited to 'src/reflect/scala/reflect/internal/util')
-rw-r--r--src/reflect/scala/reflect/internal/util/SourceFile.scala1
-rw-r--r--src/reflect/scala/reflect/internal/util/TableDef.scala17
-rw-r--r--src/reflect/scala/reflect/internal/util/WeakHashSet.scala25
3 files changed, 3 insertions, 40 deletions
diff --git a/src/reflect/scala/reflect/internal/util/SourceFile.scala b/src/reflect/scala/reflect/internal/util/SourceFile.scala
index f36c50bff1..3b6c57e955 100644
--- a/src/reflect/scala/reflect/internal/util/SourceFile.scala
+++ b/src/reflect/scala/reflect/internal/util/SourceFile.scala
@@ -34,7 +34,6 @@ abstract class SourceFile {
*/
def positionInUltimateSource(position: Position) = position
override def toString() = file.name
- def dbg(offset: Int) = Position.offset(this, offset).toString
def path = file.path
def lineToString(index: Int): String =
diff --git a/src/reflect/scala/reflect/internal/util/TableDef.scala b/src/reflect/scala/reflect/internal/util/TableDef.scala
index e97aa662d8..8708442c85 100644
--- a/src/reflect/scala/reflect/internal/util/TableDef.scala
+++ b/src/reflect/scala/reflect/internal/util/TableDef.scala
@@ -14,23 +14,14 @@ class TableDef[T](_cols: Column[T]*) {
// These operators are about all there is to it.
/** Appends a column to the table. */
def ~(next: Column[T]) = retThis(cols :+= next)
- /** Creates a right-justified column and appends it. */
- def >>(pair: (String, T => Any)) = this ~ Column(pair._1, pair._2, left = false)
- /** Creates a left-justified column and appends it. */
- def <<(pair: (String, T => Any)) = this ~ Column(pair._1, pair._2, left = true)
- /** Specifies a string to separate the previous column from the next.
- * If none is specified, a space is used. */
- def >+(sep: String) = retThis(separators += ((cols.size - 1, sep)))
// Below this point should all be considered private/internal.
private var cols: List[Column[T]] = _cols.toList
- private var separators: Map[Int, String] = Map()
- def defaultSep(index: Int) = if (index > (cols.size - 2)) "" else " "
- def sepAfter(i: Int): String = separators.getOrElse(i, defaultSep(i))
- def sepWidths = cols.indices map (i => sepAfter(i).length)
+ def defaultSep(index: Int) = if (index > (cols.size - 2)) "" else " "
+ def sepAfter(i: Int): String = defaultSep(i)
+ def sepWidths = cols.indices map (i => sepAfter(i).length)
- def columns = cols
def colNames = cols map (_.name)
def colFunctions = cols map (_.f)
def colApply(el: T) = colFunctions map (f => f(el))
@@ -57,8 +48,6 @@ class TableDef[T](_cols: Column[T]*) {
def mkFormatString(sepf: Int => String): String =
specs.zipWithIndex map { case (c, i) => c + sepf(i) } mkString
- def pp(): Unit = allToSeq foreach println
-
def toFormattedSeq = argLists map (xs => rowFormat.format(xs: _*))
def allToSeq = headers ++ toFormattedSeq
diff --git a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
index a8bc79d832..a9a7c7780d 100644
--- a/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
+++ b/src/reflect/scala/reflect/internal/util/WeakHashSet.scala
@@ -384,31 +384,6 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D
* Number of buckets in the table
*/
def bucketsCount: Int = table.size
-
- /**
- * Number of buckets that don't hold anything
- */
- def emptyBucketsCount = bucketsCount - fullBucketsCount
-
- /**
- * Number of elements that are in collision. Useful for diagnosing performance issues.
- */
- def collisionsCount = size - (fullBucketsCount - collisionBucketsCount)
-
- /**
- * A map from a count of elements to the number of buckets with that count
- */
- def elementCountDistribution = table map linkedListSize groupBy identity map {case (size, list) => (size, list.size)}
-
- private def linkedListSize(entry: Entry[A]) = {
- var e = entry
- var count = 0
- while (e != null) {
- count += 1
- e = e.tail
- }
- count
- }
}
private[util] def diagnostics = new Diagnostics