summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-04 23:40:28 +0000
committerPaul Phillips <paulp@improving.org>2011-01-04 23:40:28 +0000
commitb2fbd5a79f687312ae32fe117e49e171fea01993 (patch)
tree37f5320efc5ec9f8692eeb2222c2ddddd999bf3b /src/compiler
parent8ae754399d250a8f5bc66e8347949e5c5570ac34 (diff)
downloadscala-b2fbd5a79f687312ae32fe117e49e171fea01993.tar.gz
scala-b2fbd5a79f687312ae32fe117e49e171fea01993.tar.bz2
scala-b2fbd5a79f687312ae32fe117e49e171fea01993.zip
Eliminated 16 avoidable closure objects in Stream.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala6
-rw-r--r--src/compiler/scala/tools/nsc/util/package.scala2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index fcaa8b588b..cfa938e3dc 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -459,6 +459,12 @@ abstract class UnCurry extends InfoTransform with TypingTransformers with ast.Tr
byNameArgs += arg
arg setType functionType(List(), arg.tpe)
} else {
+ if (opt.verboseDebug) {
+ val posstr = arg.pos.source.path + ":" + arg.pos.line
+ val permstr = if (fun.isPrivate) "private" else "notprivate"
+ log("byname | %s | %s | %s".format(posstr, fun.fullName, permstr))
+ }
+
val result = localTyper.typed(
Function(Nil, arg) setPos arg.pos).asInstanceOf[Function]
new ChangeOwnerTraverser(currentOwner, result.symbol).traverse(arg)
diff --git a/src/compiler/scala/tools/nsc/util/package.scala b/src/compiler/scala/tools/nsc/util/package.scala
index 2bede3c8ca..6de2f35796 100644
--- a/src/compiler/scala/tools/nsc/util/package.scala
+++ b/src/compiler/scala/tools/nsc/util/package.scala
@@ -16,6 +16,8 @@ package object util {
/** Frequency counter */
def freq[T](xs: Traversable[T]): Map[T, Int] = xs groupBy identity mapValues (_.size)
+ def freqrank[T](xs: Traversable[(T, Int)]): List[(Int, T)] = xs.toList map (_.swap) sortBy (-_._1)
+
/** Execute code and then wait for all Threads created during its
* execution to complete.
*/