diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-05-27 11:12:48 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-06-01 16:20:09 -0700 |
commit | def22ff08692ba55e607b8948e6159bdda3f48e5 (patch) | |
tree | 89ad11892954f8e888283ace3da5ddd01e47ad9d /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | |
parent | 128ac65991210fee3d5e273e30c9f31322e1a585 (diff) | |
download | scala-def22ff08692ba55e607b8948e6159bdda3f48e5.tar.gz scala-def22ff08692ba55e607b8948e6159bdda3f48e5.tar.bz2 scala-def22ff08692ba55e607b8948e6159bdda3f48e5.zip |
opt: fuse some operations on `Scope`s
`Scope`'s `filter` is implemented using `toList`,
so may as well start with `toList`ourselves.
Also fused some `filter`/`foreach` combos.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 2d454c2fe6..a5a680d135 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -172,12 +172,12 @@ abstract class RefChecks extends InfoTransform with scala.reflect.internal.trans // This has become noisy with implicit classes. if (settings.warnPolyImplicitOverload && settings.developer) { - clazz.info.decls filter (x => x.isImplicit && x.typeParams.nonEmpty) foreach { sym => + clazz.info.decls.foreach(sym => if (sym.isImplicit && sym.typeParams.nonEmpty) { // implicit classes leave both a module symbol and a method symbol as residue val alts = clazz.info.decl(sym.name).alternatives filterNot (_.isModule) if (alts.size > 1) alts foreach (x => reporter.warning(x.pos, "parameterized overloaded implicit methods are not visible as view bounds")) - } + }) } } |