From 212c55d5bc3e87e3b1940502d55be9c2dcbf9326 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 28 Oct 2013 12:29:22 +0100 Subject: Microptimization in implicit search Avoid creating a throwaway list of parameter types. --- src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/Implicits.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index c19d861d23..987a3d2202 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -216,7 +216,8 @@ trait Implicits { case NullaryMethodType(restpe) => containsError(restpe) case mt @ MethodType(_, restpe) => - (mt.paramTypes exists typeIsError) || containsError(restpe) + // OPT avoiding calling `mt.paramTypes` which creates a new list. + (mt.params exists symTypeIsError) || containsError(restpe) case _ => tp.isError } -- cgit v1.2.3