diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 16:28:43 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 16:31:25 +0100 |
commit | 3d2eba9964446b88c8afdbe0a84d6b52a1094ff5 (patch) | |
tree | 2a70360fe0ed18c755921eb11bcf6bcc7a5bace4 /src | |
parent | 8536c3148d5a6283b580a905ca4231e852525d59 (diff) | |
download | scala-3d2eba9964446b88c8afdbe0a84d6b52a1094ff5.tar.gz scala-3d2eba9964446b88c8afdbe0a84d6b52a1094ff5.tar.bz2 scala-3d2eba9964446b88c8afdbe0a84d6b52a1094ff5.zip |
Optimization: remove assertion from SubstMap constructor
A profile [1] reported 3% of a compile run was spent here.
This commit demotes the eager check to -Xdev.
This assertion was added in e557acb9a7.
[1] https://dl.dropboxusercontent.com/u/106552/perf/rudder-nailgun-2014-02-18-1.snapshot
Diffstat (limited to 'src')
-rw-r--r-- | src/reflect/scala/reflect/internal/tpe/TypeMaps.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala index 07c9242bf3..0cd0387670 100644 --- a/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala +++ b/src/reflect/scala/reflect/internal/tpe/TypeMaps.scala @@ -667,7 +667,8 @@ private[internal] trait TypeMaps { /** A base class to compute all substitutions */ abstract class SubstMap[T](from: List[Symbol], to: List[T]) extends TypeMap { - assert(sameLength(from, to), "Unsound substitution from "+ from +" to "+ to) + // OPT this check was 2-3% of some profiles, demoted to -Xdev + if (isDeveloper) assert(sameLength(from, to), "Unsound substitution from "+ from +" to "+ to) /** Are `sym` and `sym1` the same? Can be tuned by subclasses. */ protected def matches(sym: Symbol, sym1: Symbol): Boolean = sym eq sym1 |