aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Inferencing.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-02-22 12:27:19 +0100
committerMartin Odersky <odersky@gmail.com>2014-02-24 18:56:48 +0100
commit691bae22c373bc72ad77cdd1968c35a445c34437 (patch)
tree40f6c70a7e0768cd3ad299be1da38112ec3be54a /src/dotty/tools/dotc/typer/Inferencing.scala
parentafb74449e0443d321da4b79e776eab376fdc51b1 (diff)
downloaddotty-691bae22c373bc72ad77cdd1968c35a445c34437.tar.gz
dotty-691bae22c373bc72ad77cdd1968c35a445c34437.tar.bz2
dotty-691bae22c373bc72ad77cdd1968c35a445c34437.zip
Performance improvement: Specialize folds in accumulators.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Inferencing.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index a8003f8c2..19a6f3bb5 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -249,7 +249,8 @@ object Inferencing {
def map(tm: TypeMap)(implicit ctx: Context): PolyProto =
derivedPolyProto(targs mapConserve tm, tm(resultType))
- def fold[T](x: T, ta: TypeAccumulator[T])(implicit ctx: Context): T = ta((x /: targs)(ta), resultType)
+ def fold[T](x: T, ta: TypeAccumulator[T])(implicit ctx: Context): T =
+ ta(ta.foldOver(x, targs), resultType)
}
/** A prototype for expressions [] that are known to be functions: